Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement POST_COMMAND_INCOMPLETE? #107

Closed
MadsBen opened this issue Dec 9, 2021 · 4 comments · Fixed by #109
Closed

Implement POST_COMMAND_INCOMPLETE? #107

MadsBen opened this issue Dec 9, 2021 · 4 comments · Fixed by #109

Comments

@MadsBen
Copy link

MadsBen commented Dec 9, 2021

Restic has 3 exit status codes:

  • 0 when the backup was successful (snapshot with all source files created)
  • 1 when there was a fatal error (no snapshot created)
  • 3 when some source files could not be read (incomplete snapshot with remaining files created)

Code 1 and 3 both results in POST_COMMANDS_FAILURE to be executed, which is a bit misleading, since code 3 is not a failure.
An additional POST_COMMANDS_ option would be nice, to cover code 3.

Here's an example from the log, where there is a warning, but no failure, but it executes the POST_COMMANDS_FAILURE:

snapshot 7dd83929 saved
Warning: at least one source file could not be read
curl -X POST --data "{\"title\": \"Backup failed!\", \"body\": \"Backup failed. Go fix!\"}" http://restic_notify:5000
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100    61    0     0  100    61      0     43  0:00:01  0:00:01 --:--:--    43
100    63  100     2  100    61      1     31  0:00:02  0:00:01  0:00:01    32
ok
(0x51cae0,0x5a2fd8)
Stopping
Waiting
Exiting
@djmaze
Copy link
Owner

djmaze commented Dec 11, 2021

@MadsBen That is an interesting point. I was not aware of that.

Makes total sense to have a separate command for those "non-fatal" errors. I could totally make use of that! Will try to implement this.

@stale
Copy link

stale bot commented Mar 30, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Mar 30, 2022
@MadsBen
Copy link
Author

MadsBen commented Apr 8, 2022

I still think this is relevant.

@stale stale bot removed the wontfix label Apr 8, 2022
@MadsBen
Copy link
Author

MadsBen commented Apr 21, 2022

Just want to add, that it works. Great job.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants