IPFire can be set up to generate an automatic rsync backup (synchronization) on connection of a dedicated USB hard drive to the USB port.
Data to be backed up is located on a local disk. The target file system is NTFS.
filename = /etc/udev/rules.d/23-usb.rules
ACTION=="add", SUBSYSTEMS=="usb", KERNEL=="sd?1", RUN+="/bin/usb_mount_wrapper.sh"
filename = /bin/usb_mount_wrapper.sh
#!/bin/bash
/bin/usb_mount.sh &
exit 0
filename = /bin/usb_mount.sh
#!/bin/bash
export PATH=/usr/sbin:/sbin:/usr/bin:/bin:/usr/local/bin:
function log() {
echo "$@"
logger -t backup "#### $@ ####"
}
SOURCE="***your source***"
DEST="/mnt/usb-backup"
date=$(date +%Y%B%d)
log ".....Specialmount NTFS Label Backup......"''
mount.ntfs-3g /dev/disk/by-label/usb-backup /mnt/usb-backup
log ".......start Backup............."
rsync -arlDuv --delete $SOURCE $DEST --log-file=$DEST/$date.txt
log ".......Backup done.............."
log ".......umount usb-hdd..........."
umount /mnt/usb-backup
Before the first test you must reboot the IPFire, format the USB drive as NTFS and you have to label it "usb-backup". By labeling the drive, you prevent other connected USB hard drives being accidentally overwritten.
To check the backup performed a log file is generated by rsync, which is stored with the current date as a text file on the target USB drive.
Older Revisions • August 27, 2019 at 9:52 pm • Jon