borg icon indicating copy to clipboard operation
borg copied to clipboard

recreate exclude pattern does not match the create pattern

Open fsironman opened this issue 9 years ago • 2 comments

Tested with borg-linux64_1.1.0b6 on a copy of a borg 1.0.9 repository.

I have an existing Archive: borg create -v -p -s -x -C lzma,6 --chunker-params 10,23,16,4095 /media/cifs/irondatagrave/Backup/IRONMINI-LINUX/borg::root-2017-07-21-00_44 /etc /home/myuser -e '/home/myuser/.cache'

I recently installed Steam and noticed the Repository growing by a lot. So I added -e '/home/myuser/.steam' to my borg create commandline

I also decided to try out the recreate option. To get the steam folder out of the old backup.

./borg-linux64_1.1.0b6 --debug recreate --chunker-params 10,23,16,4095 --dry-run --list /mnt/samba/Backup/IRONMINI-LINUX/borg::root-2017-07-21-00_44 -e '/home/myuser/.steam'

However this does not work I have to use the following command to get it to work: ./borg-linux64_1.1.0b6 --debug recreate --chunker-params 10,23,16,4095 --dry-run --list /mnt/samba/Backup/IRONMINI-LINUX/borg::root-2017-07-21-00_44 -e 'home/myuser/.steam'

If I specify the exclude pattern with the leading slash it wont delete it from my backup.

No big deal but as you write in the doc --exclude should have the exact same semantics as in “borg create” I should be able to just copy paste the command-line from create to recreate.

The example in the docs probably wont work either.

# Remove unwanted files from all archives in a repository
$ borg recreate /mnt/backup -e /home/icke/Pictures/drunk_photos

fsironman avatar Jul 21 '17 09:07 fsironman

The options have the same semantics, but as the next sentence says, archives only contain relative paths:

Note that all paths in an archive are relative, therefore absolute patterns/paths will not match (--exclude, --exclude-from, PATHs).

Automatically fixing this up for simple patterns is the topic of #2763

enkore avatar Jul 21 '17 09:07 enkore

Docs bug: The "Remove unwanted files" example is wrong. -- fixed by #2849.

enkore avatar Jul 21 '17 09:07 enkore