Thank you for your help!
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.
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 .
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`
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
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.
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.
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?
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.
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!