borgbackup / borg

Deduplicating archiver with compression and authenticated encryption.
https://www.borgbackup.org/
Other
10.73k stars 734 forks source link

Move path within repo #8191

Closed CrysK closed 2 months ago

CrysK commented 2 months ago

Hi folks,

I have saved the paths /boot /etc /opt /root /usr /var directly on the device in a repo. Now the paths have been mounted to (for example) /mnt/host. If I now make a backup of (e.g.) /mnt/host/boot then the paths are of course no longer correct. The repo should still save the boot folder as /boot (and not /mnt/host/boot).

I have already tried using

export BORG_BASE_DIR=/mnt/host/
borg create /mnt/repo/test::'{hostname}-{now}' boot

but then the wrong boot folder is backed up.

Data: Ubuntu 22, borg 1.2.8, (w/ and w/o docker)

How to backup a relative path in a repo?

Thank you!

CrysK commented 2 months ago

Sorry, too less coffee.

cd /mnt/host
borg create /mnt/repo/test::'{hostname}-{now}' boot

... that's the trick!

ThomasWaldmann commented 2 months ago

After the cd ..., you can also give . as the path to back up.