Git Product home page Git Product logo

Comments (16)

cupcakearmy avatar cupcakearmy commented on July 17, 2024 1

Currently not but thats a good idea to have a flag. Will look into it the next days :)

from autorestic.

stosem avatar stosem commented on July 17, 2024 1

Moreover, I can't detect failed tasks with Ansible.
autorestic always return 0 (success) as rc. Doesn't matter task was succeeded or not. And I can't catch Failed! on stdout:

Ansible stdout:

            "\u001b[4m\u001b[90m",
            "Configuring Backends\u001b[39m\u001b[24m",
            "\u001b[2K\u001b[1G\u001b[90m\u001b[4m",
            "Backing Up\u001b[24m\u001b[39m",
            "Files:           0 new,     1 changed,     0 unmodified",
            "Dirs:            0 new,     0 changed,     0 unmodified",
            "Added to the repo: 379 B",
            "",
            "processed 1 files, 2.500 KiB in 0:00",
            "snapshot bc536bdb saved null does not exist, skipping",
            "\u001b[2K\u001b[1GFiles:           0 new,     0 changed,     1 unmodified",
            "Dirs:            0 new,     0 changed,     0 unmodified",
            "Added to the repo: 0 B  ",
            "",
            "processed 1 files, 33 B in 0:00",
            "snapshot ed75da09 saved null does not exist, skipping",
            "\u001b[2K\u001b[1Gnull null",
            "\u001b[2K\u001b[1G\u001b[4m",
            "Finished!\u001b[24m 🎉"

While real output contains errors:

Configuring Backends
local-storage : Done ✓

Backing Up
test_docker ▶ local-storage : Backing up... ⏳Files:           0 new,     1 changed,     0 unmodified
Dirs:            0 new,     0 changed,     0 unmodified
Added to the repo: 379 B

processed 1 files, 2.500 KiB in 0:00
snapshot 2ce6f9b7 saved null does not exist, skipping
test_docker ▶ local-storage : Failed! (1s) null does not exist, skipping
test_home ▶ local-storage : Backing up... ⏳Files:           0 new,     0 changed,     1 unmodified
Dirs:            0 new,     0 changed,     0 unmodified
Added to the repo: 0 B

processed 1 files, 33 B in 0:00
snapshot 0ac6f2e1 saved null does not exist, skipping
test_home ▶ local-storage : Failed! (771ms) null does not exist, skipping
test_web ▶ local-storage : Backing up... ⏳null null
test_web ▶ local-storage : Failed! (5ms) null

from autorestic.

cupcakearmy avatar cupcakearmy commented on July 17, 2024 1

Hey, sry I forgot that was an issue. Probably I could rewrite the whole logging thing. It's quite ugly anyways.

from autorestic.

sumnerboy12 avatar sumnerboy12 commented on July 17, 2024 1

Ok - the output is cleaned up but there is no mention of which backend/location is being processed. It just looks like the raw restic output I think. Any chance we can get more detailed logging of what is actually being processed? Very hard to tell in the log below what repo has been backed up etc. NOTE: this is running with --verbose.

Configuring Backends

Backing Up
Files:           0 new,     0 changed, 22690 unmodified
Dirs:            0 new,     0 changed,   605 unmodified
Added to the repo: 0 B

processed 22690 files, 86.238 GiB in 0:13
snapshot 28bfb301 saved
Files:           0 new,     0 changed, 22690 unmodified
Dirs:            0 new,     0 changed,   605 unmodified
Added to the repo: 0 B

processed 22690 files, 86.238 GiB in 0:02
snapshot a2c0c4b1 saved

Finished!  ^=^n^i

from autorestic.

sumnerboy12 avatar sumnerboy12 commented on July 17, 2024 1

from autorestic.

cupcakearmy avatar cupcakearmy commented on July 17, 2024 1

So.. it's been a long time. I've rewritten the whole thing in Go the past week and it's way more stable (and smaller).
@sumnerboy12 should be fixed. Feel free to repoen if that is not the case.
Note the (small) upgrade guide https://autorestic.vercel.app/upgrade

from autorestic.

sumnerboy12 avatar sumnerboy12 commented on July 17, 2024

Would it be worth using a proper logging framework? Something like tslog perhaps? I have zero experience with TS so there may well be better options.

from autorestic.

cupcakearmy avatar cupcakearmy commented on July 17, 2024

So. I've added a --ci (version 0.22+) global flag which disables the interactive part.
https://autorestic.vercel.app/cli/general#--ci

@stosem you are right should not return 1 on failed. I will do that next.
Feel free to reopen if it doesnt work for you 👍
And sry for the delay, you opened the issue almost half year ago 🙈

from autorestic.

cupcakearmy avatar cupcakearmy commented on July 17, 2024

@stosem now returns with exit code 1 if a backup fails (v0.24)

from autorestic.

sumnerboy12 avatar sumnerboy12 commented on July 17, 2024

Thanks for this @cupcakearmy and please don't apologise for implementing a feature for free on an OSS project!! It is much appreciated.

Unfortunately it doesn't seem to work as expected, see below for how my log now looks;

Configuring Backends
^[[2K^[[1G^[[2K^[[1G^[[2K^[[1G^[[2K^[[1G^[[2K^[[1G^[[2K^[[1G^[[2K^[[1G^[[2K^[[1G^[[2K^[[1G
Backing Up
Files:           0 new,     0 changed, 22690 unmodified
Dirs:            0 new,     0 changed,   605 unmodified
Added to the repo: 0 B

processed 22690 files, 86.238 GiB in 0:05
snapshot 3ac11269 saved
^[[2K^[[1GFiles:           0 new,     0 changed, 22690 unmodified
Dirs:            0 new,     0 changed,   605 unmodified
Added to the repo: 0 B

So it is now printing the output to the log file (before it wasn't showing anything), but there seems to be some sort of encoding issue? Any ideas?

from autorestic.

cupcakearmy avatar cupcakearmy commented on July 17, 2024

Yes. But un maintained projects always make me angry 😅
I'm sure that is the coloring. I'll comment it out if using --ci

from autorestic.

cupcakearmy avatar cupcakearmy commented on July 17, 2024

Should be fixed in 0.25 CI is building, as soon it's done it will upload it and you can autorestic upgrade
Also of course pass the --ci flag to the cron. :)
Let me know 😊

from autorestic.

cupcakearmy avatar cupcakearmy commented on July 17, 2024

I just checked. So this happens only with the --verbose flag. I'm going to look into it and see what happens there
Withouth the --verbose and only --ci flag there is a list of what happened

from autorestic.

sumnerboy12 avatar sumnerboy12 commented on July 17, 2024

I just tested without --verbose and didn't notice any difference. Here is the output when running from the command line;

root@pve:/home/ben# /usr/bin/autorestic --config /etc/.autorestic.yml --ci backup --location nas-personal

Configuring Backends
b2-personal : Configuring... ⏳
b2-personal : Done ✓
rest-personal : Configuring... ⏳
rest-personal : Done ✓

Backing Up
nas-personal ▶ b2-personal : Backing up... ⏳
nas-personal ▶ b2-personal : Done ✓ (8s)
               rest-personal : Backing up... ⏳
               rest-personal : Done ✓ (1s)

Finished! 🎉

And then exactly the same command, but piping to a log file results in;

root@pve:/home/ben# /usr/bin/autorestic --config /etc/.autorestic.yml --ci backup --location nas-personal >> test.log
root@pve:/home/ben# cat test.log

Configuring Backends

Backing Up

Finished! 🎉

from autorestic.

sumnerboy12 avatar sumnerboy12 commented on July 17, 2024

@cupcakearmy sorry to keep bugging you but is this still on your radar? it is not a major by any stretch but it would be great to have more useful logging for reconciliation and validation. no problem if you have higher priority issues to attend to of course!

from autorestic.

cupcakearmy avatar cupcakearmy commented on July 17, 2024

It's on the list 🙂 I'm just burried in academic stuff right now unfortunately 😒 End of March there could be light xD

from autorestic.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.