Endeavouros snapshot related issues

This is the relevant part of my systemd unit:

ExecStart=systemd-inhibit --who="borgmatic" --why="Prevent interrupting scheduled backup" /usr/bin/borgmatic  --syslog-verbosity 1

So yes, it could be the path.

[csteinforth@E14 ~]$ which borgmatic 
/usr/bin/borgmatic

Thank you for your help! :heart:
I have the same configuration as you.I can’t auto backup yet, the reason is that I can’t get the password automatically, I’m still troubleshooting the reason.

I have successfully backed up, but when I sudo borgmatic list, sometimes it appears that:

Failed to create/acquire the lock /run/media/scvg009/c2/backup/system/lock.exclusive (timeout).
/run/media/scvg009/c2/backup/system: Error running actions for repository
Command 'borg list /run/media/scvg009/c2/backup/system' returned non-zero exit status 2.
/etc/borgmatic/config.yaml: Error running configuration file

summary:
/etc/borgmatic/config.yaml: Error running configuration file
/run/media/scvg009/c2/backup/system: Error running actions for repository
Failed to create/acquire the lock /run/media/scvg009/c2/backup/system/lock.exclusive (timeout).
Command 'borg list /run/media/scvg009/c2/backup/system' returned non-zero exit status 2.

Have you set SOFT FAILURE COMMAND HOOKS, and if so, how is it configured?

I am now able to backup, and read backup files normally, I now want to restore the backup files, do I restore the backup files directly or do I have to extract the backup files first? I confirm where my backups are stored, but when I use borgmatic restore I get the following error.

> sudo borgmatic restore --repository /run/media/scvg009/c2/home --archive box-dfdf-2021-09-29T20:05:08.507173
/run/media/scvg009/c2/home: Error running actions for repository
No databases were found to restore
/etc/borgmatic.d/home.yaml: Error running configuration file

summary:
/etc/borgmatic.d/home.yaml: Error running configuration file
/run/media/scvg009/c2/home: Error running actions for repository
No databases were found to restore

Need some help? https://torsion.org/borgmatic/#issues

The restore command is to dump a database from an archive.

The way to restore a backup is to either to mount the archive and do an rsync, or, if you only want to extract only certain files, to extract the archive, see the command line reference. I have no experience on this since there was no need so far :sunglasses: .

I have no configuration on this.

Maybe you could try to release the lock like

sudo borg break-lock /run/media/scvg009/c2/backup/system`

Make sure no backup is running at that moment.

Thanks for your help, I had to test it well before I could use it with confidence.
The official documentation does not mention mounting the archive to restore the backup

1 Like

Mount it like this

sudo borgmatic mount --config /etc/borgmatic/config.yaml --mount-point /mnt/borg/

and run a rsync dry run on an archive

rsync -avirn --delete-after --exclude-from '/mnt/data/exclude.list' /mnt/borg/E14-2021-09-27T17\:57\:25.600692/ / > /mnt/data/test.txt

with the exludes:

$ cat /mnt/data/exlude.list

/boot/efi
/dev
/proc
/sys
/media
/mnt
/tmp
/run
/var/run
/var/lock
/var/lib/docker
/var/lib/schroot
/lost+found
/timeshift
/timeshift-btrfs
/data
/DATA
/cdrom
/sdcard
/system
/etc/timeshift.json
/var/log/timeshift
/var/log/timeshift-btrfs
/swapfile
/snap
/root/.thumbnails
/root/.cache
/root/.dbus
/root/.gvfs
/root/.local/share/[Tt]rash
/home/*/.thumbnails
/home/*/.cache
/home/*/.dbus
/home/*/.gvfs
/home/*/.local/share/[Tt]rash
/root/.mozilla/firefox/*.default/Cache
/root/.mozilla/firefox/*.default/OfflineCache
/root/.opera/cache
/root/.kde/share/apps/kio_http/cache
/root/.kde/share/cache/http
/home/*/.mozilla/firefox/*.default/Cache
/home/*/.mozilla/firefox/*.default/OfflineCache
/home/*/.opera/cache
/home/*/.kde/share/apps/kio_http/cache
/home/*/.kde/share/cache/http
/var/cache/apt/archives
/var/cache/pacman/pkg
/var/cache/yum
/var/cache/dnf
/var/cache/eopkg
/var/cache/xbps
/var/cache/zypp
/var/cache/edb
/root
/home/*/

Check the result file for the differences.

You have to adjust this to fit your needs. In an actual case of restoring a whole backup I`d rather run this in a live environment or chroot.

Thanks :heart:, I understand, I’m going to try it now.

I don’t know if there is something wrong with my understanding or the official documentation is not written clearly enough, but if you install the official documentation to do so, it is impossible to restore the backup.

You can find some additional information here or here.

I’ve been able to extract the backup now, but I don’t know what command I can use to restore it. borgmatic itself doesn’t have a command to restore the backup? Do I have to use rsync?
I tried to extract the /directory backup directly back to the /directory, but I found that nothing changed.
I don’t know if I misunderstood the use of borgmatic, for example: I backed up my whole system excluding the home directory, then I installed a software after the backup was finished, at that time, I restore the backup, then the software I installed should not exist anymore.

See my post above. In order to restore a backup you’ll need to do an rsync.

borg does a full backup of your system, or at least the directories you configured. Restoring a backup via rsync will delete everything on your hard disk which is not part of the backup. But be careful and do a dry run before actually doing a restore.

Where is /mnt/data/exclude.list a file from?

Those are the same excludes you use in your borgmatic config.

Please tell me how this file was generated.
Can you explain rsync -avirn --delete-after --exclude-from '/mnt/data/exclude.list' /mnt/borg/E14-2021-09-27T17\:57\:25.600692/ / > /mnt/data/test. txt
How is exclude.list generated in /mnt/2021-0927T\:57\:25.600692/ > /mnt/data/test.txt ? What does the end of the code > /mnt/data/test/txt mean?

I have a new problem, I backed up the /directory, excluding

/dev /home /proc /run /sys /tmp

, and then mounted the restore file to

/run/media/df/c2/1

I used

sudo rsync -avir --delete --exclude-from ‘/home/df/exlude .list’ /run/media/df/c2/1/ /

After the recovery was done, I found that only the files I excluded were left in my system, all the files that needed to be recovered were lost, and then the system was corrupted.


Now there are only these directories in the system

This command restores the archive to / in a dry run and redirects the output to the textfile /mnt/data/test.txt in order to check the if it was the real run.

I don’t know what could have happened here. Maybe your exclude list had some wrong entries.

I have a doubt, we already exclude the directories that we don’t need to backup when we backup, so why do we have to exclude them when we restore? They were not in the backup in the first place.

@csteinforth I think the problem about borgmatic backup is solved, now it’s a matter of how to restore, I think I should post a new thread for help, thanks for all the help you’ve given me in the meantime, thanks!