Logging results/output of backups and checks on Windows 10 #126
-
I have an application running on my PC that checks various things including my current backup solution so there's no need to send emails or anything. But like my current backup solution, I'd like to have a log to check to make sure it ran successfully and to check for errors. I first tried using RESTIC_NOTIFY_BACKUP_STATS and RESTIC_BACKUP_NOTIFICATION_FILE, but you don't get much information on success and it doesn't seem to produce anything on failure. Even if I just had one file that was write-locked it would complete the snapshot but not produce the file. I figured out how to get the output of restic_backup.sh by modifying the scheduled task action:
But then I tried doing the same with restic_check.sh and this was my output:
Looking at the script, it seems to be because it uses echo to run the command. Also, it would be great if it didn't open a bash window when the scheduled task ran. I'm considering just running everything through my application with C# Process to try to make this work but I know it's gonna be a fun time passing and escaping all the arguments correctly. So if anyone knows a better way, that would be great. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
Not having the terminal window pop up during backup would be useful, if the solution is simple and doesn’t add dependencies. I’d like to not add too much functionality at this point given the https://github.com/erikw/restic-automatic-backup-scheduler#project-scope :) |
Beta Was this translation helpful? Give feedback.
-
It's hard to say until seeing what what means ¯_(ツ)_/¯ . The intention of this repo is to be a base for further hacking to make a personal perfect backup solution. So if you have the motivation, aim to implement this for yourself as your main goal. Then if suitable (small, low complexity, not adding dependencies) it could be added here too :)
Yes indeed! Removed in 48ec2f9 |
Beta Was this translation helpful? Give feedback.
-
So I've got a script but it's not perfect. It flickers up a powershell window for a split second, but at least nothing stays open. You can prevent that by setting it to run whether the user is logged on or not, which seems to work for me but I'm not sure I'd trust it as a default. The main issue though is that I'm not sure the install script could handle it cleanly. Here's the example usage: Program: powershell.exe And here's what the script is doing:
I tried getting the task to fail with the exit codes, but it doesn't seem to want to. It lists it as the last run result but still succeeds. |
Beta Was this translation helpful? Give feedback.
-
Ya, there might be some issues with putting this in the project (getting this to work with the install script that creates the scheduled tasks mainly), but I wanted to post it here anyway for other people to find if they need it. |
Beta Was this translation helpful? Give feedback.
It's hard to say until seeing what what means ¯_(ツ)_/¯ . The intention of this repo is to be a base for further hacking to make a personal perfect backup solution. So if you have the motivation, aim to implement this for yourself as your main goal. Then if suitable (small, low complexity, not adding dependencies) it could be added here too :)
Yes indeed! Removed in 48ec2f9