On 3/26/22 08:03, Kenneth Porter wrote:
I'm adding a second external drive to my rotation so I can keep one off-site in case of disaster.

How do people handle this? What do your systemd mount/automount unit files look like? Do you use a single drive label so a single systemd unit works to mount any backup drive to the same mount point?



I use a common drive label for the four disks I rotate. I recommend auto mount so that if your machine should restart for any reason the disk will remount protecting the local drive from running out of space. I manually stop and start the backuppc.service and then have a couple scripts, one to umount the drive and another to remount. I set this up a long time ago under version 3 and I think it is more complicated than is necessary now in version 4. At the time it was recommended in a guide I was using not to directly mount an external drive to /var/lib/backuppc but instead to mount the external drive elsewhere on the system and then bind mount that location to /var/lib/backuppc. So my fstab entry looks like this for that condition:

/LABEL=/backupdisk     /data/backup      auto    defaults        0 0 /data/backup/BackupPC  /var/lib/BackupPC   non     bind          0 0

/This is the script ( bupcdiskinit ) to mount the disk:

/#!/bin/bash
# USB backup disk initialization file

mount /data/backup

if [ ! -d /data/backup/BackupPC ];then

    mkdir /data/backup/BackupPC

    cd /data/backup/BackupPC

    mkdir cpool pool pc

    cd ..

    chown -R backuppc.backuppc BackupPC

    cd /

else

    echo "BackupPC exists"

fi

wait=1

mount /var/lib/BackupPC

# end of script

######################################

/This script (umbudisk ) unmounts:

/#!/bin/bash
# USB backup disk unmount

umount /var/lib/BackupPC
umount /data/backup



# end of script

/########################

I'm sure that you can simplify this by removing the double mount.


////

--
Jim Kelly-Rand
j...@kjkelra.com

_______________________________________________
BackupPC-users mailing list
BackupPC-users@lists.sourceforge.net
List:    https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:    https://github.com/backuppc/backuppc/wiki
Project: https://backuppc.github.io/backuppc/

Reply via email to