framps / raspiBackup

Create and keep multiple backup versions of your running Raspberries
https://raspibackup.linux-tips-and-tricks.de
GNU General Public License v3.0
826 stars 75 forks source link

Use a temporary backup directory #628

Closed framps closed 1 month ago

framps commented 1 year ago

As of now the new backup directory is created below the backupdirectory of the saved system. If the backup fails this directory is deleted.

In order to catch failed backups which leave an incomplete backupdirectory the backups should be created in a temp directory on the backupspace and if the backup succeeds this directory should be moved into the backup directory. If the backup fails this temp directory should be deleted when the next backup run finishes.

That way incomplete backups don't screw up the backup directories.

p1r473 commented 1 year ago

I have a question related to backup dirs. I didnt want to create an entire issue for it as it is related to backup directory but let me know if youd rather questions be in their whole own issue. I have my backup directory set to /mnt/$HOSTNAME But, the backup seems to go into /mnt/$HOSTNAME/$HOSTNAME Is this working as intended? What I ended up doing was making on my remote server /backups/hostname/hostname and then in /etc/fstab mounting \REMOTESERVER\HOSTNAME as /backups/hostname That way, the backup ends up going into /mnt/$HOSTNAME instead of /mnt/$HOSTNAME/$HOSTNAME

framps commented 1 year ago

Is this working as intended?

Yes. raspiBackup creates in the backupdirectory for every hostname a dedicated subdirectory. For every host a new subdirectory is created.

I have my backup directory set to /mnt/$HOSTNAME

I suggest to use /backup as the backup mountpoint. But if you want to use /mnt just use /mnt and not /mnt/$HOSTNAME

p1r473 commented 1 year ago

Thanks for clearing that up! Im using /mnt/$HOSTNAME because I have 2 of my Pis mount both of each of their mountpoints, in case I need to use Pi1 to restore Pi2 or Pi2 to restore Pi1!

framps commented 1 year ago

Merged into development branch

framps commented 1 year ago

Given the fact next release 0.6.9 should be shipped this enhancement is delayed because the current implementation doesn't allow concurrent backups to happen from different systems.