-
Notifications
You must be signed in to change notification settings - Fork 101
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
restic_backup.sh backs up supplied paths, but also the folder it's being executed from #125
Comments
The best way to figure out what’s is happening to look at the actual restic commandant that are being executed. Run the backup script with the bash -x flag and identify the git-bash$ source /etc/restic/default.env.sh
git-bash$ restic init
git-bash$ bash -x restic_backup.sh |
I'm in the middle of a long upload (made an empty folder and ran the script from there) that I don't want to mess with, but I'll try it once that's done. What I can note from the currently running command is that it's not listed in the "start scan on [" and "start backup on [" lines but it is in the completed snapshot. |
I added a debugging section https://github.com/erikw/restic-automatic-backup-scheduler#debugging |
Here's the start of the command it's sending:
Is the |
Oh this might be related Are you in the latest commit on the main branch of the repo? |
I have everything but today's commits, so I'm at the October 3rd "Add stale action" commit. Potentially the "Include minimal one argument in extra args array" commit from that pull request might fix it? But I don't understand bash script well enough to say for sure. |
I'm trying to reproduce this, to get |
_global.env.sh
default.env.sh
|
Currently I've just removed the line that adds the extra args from the backup script and that works for now. Potentially just combining the different arrays before calling the command would fix it? I can try that if you want. |
Thank you for sharing the config. When I set up and use your restic backup --verbose=1 --one-file-system --tag systemd.timer --option b2.connections=10 --exclude-file /etc/restic/backup_exclude.txt /C/backup /C/Code /C/Git <... redacted ...> /S/Shows and I don't see that
I ran this on a macOS system with bash version What bash version are you on?It might be an issue on your bash version or/and in combination with the Windows environment. I'm unable to support Windows at the moment as I have no access to such system anymore. Really not a solution... but I wonder if it happens to work around the issue if you would swap the order of these 2 lines? restic-automatic-backup-scheduler/bin/restic_backup.sh Lines 111 to 112 in 1c0ba09
|
I tried a few different things since I'm using the extra parameters for one backup now and not another, so I couldn't just remove them anymore. Combining didn't work and even only combining if there was something in the array didn't work, because I realized that the extra args array was reporting a size of 1 even when the original variable was empty. Here's what did work:
So it seems that potentially just in windows, that method of building the array from the args variable doesn't work quite right. |
That fix looks good to me! Applied. |
Awesome. Thanks again for all the help and quick responses! Everything's working now and my god is it better than SpiderOak. Uploaded overnight what it took literally weeks to upload to them, and I finally have fine grained control of retention policies that actually work. |
On Windows 10, and whether I run from bash or the scheduled task, it backs up the folders I've supplied as well as the current directory. Here's my RESTIC_BACKUP_PATHS:
export RESTIC_BACKUP_PATHS="/c/Git:/c/Code" # *EDIT* fill conveniently with one or multiple paths
This was a bit annoying when I was running through bash and I was in the "restic-automatic-backup-scheduler" directory, but it got worse when the scheduled task ran and it tried to back up System32.
Any idea what's happening?
The text was updated successfully, but these errors were encountered: