-
Notifications
You must be signed in to change notification settings - Fork 204
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
Bug/Feature: "additional options to rsync" not used when removing snapshots #1861
Comments
Thank you for this detailed report. I wonder if it might be more secure to separate the "additional rsync options" between take snapshot & remove. Maybe an extra dialog window offering three fields: "additional rsync options..." 1) for all rsync operations 2) for take snapshot only 3) for remove snapshots. I wouldn't recommend to run rsync your self as you suggested. Anyway. It wonders me that setting the environment variable has no effect. To my knowledge this should work. RSYNC_MAX_ALLOC is supported by rsync since version 3.2.2. You are at 3.3.0. What about your error message when using the environment variable? Do you still see "exceeded --max-alloc=1073741824 setting" or something like "exceeded --max-alloc=5G setting"? Can you run BIT with "--debug" please. There you can find the real rsync-command used for removing snapshots. I couldn't find an indication in the source code but it might be that somewhere else --max-alloc is explicit set and that is why the environment variable is ignored. |
Thanks for your quick reply. I'll run BiT with "--debug" later today. I've got the snapshot removed in the end by repeatedly removing it until it was completely removed, so I'm not sure if I can reproduce myself anymore. |
Output with --debug:
I double check the environmental variable with the Could it be that the python script is running in it's own environment and therefor the systems environment variables are ignored? |
Yes, that is the case. I always forget that. For your workaround open the starter scripts I tried to reproduce the behavior with that script:
And calling it:
But I still see all (?) environment variables. I would expect I wouldn't see them. I am confused. |
Same here. I'm also not sure if this is the way to go. It might add additional challenges to get it working with cron, but I'm not sure. Your proposal with the 3 fields sounds good to me. |
Another short term workaround for you would be to directly edit tools.py in your installation and add the extra option. Line 1107 in 8c7afef
|
Yes, that worked. Thanks for the hint. |
Short: Additional rsync options (Expert Options -> Paste additional options to rsync) not used when removing snapshots.
When I want to remove a snapshot, I get the error:
According to the rsync man page (I'm using version 3.3.0), the default value for --max-alloc (default is 1g) can be overridden with the --max-alloc=SIZE option.
But when I set this option under Expert Options -> Paste additional options to rsync -> --max-alloc=5g, this option is only passed to the command line when taking a new snapshot. Not when removing a snapshot.
Looking in snapshots.py, the rsync_prefix (which includes
if config.rsyncOptionsEnabled(): cmd.extend(shlex.split(config.rsyncOptions()))
) is only set in the takeSnapshot routine, not in the remove routine.Shouldn't the rsyncOptions also be used in the remove routine? This was already requested in #1507, but for another reason.
How can I work around this? Is it safe to manually run the
rsync -a --delete -s /tmp/tmps8asu05e/ /mnt/databackup/backintime/backintime/gentoo/root/1/20240502-194442-488
command with the--max-alloc=5g
option? Should I then create an empty directory /tmp/tmps8asu05e/ first?Or just remove the
/mnt/databackup/backintime/backintime/gentoo/root/1/20240502-194442-488
directory?I've also set the RSYNC_MAX_ALLOC environment variable to 5g (as described in the rsync man page), but this doesn't make a difference.
The text was updated successfully, but these errors were encountered: