Files from Blogpost

This commit is contained in:
2026-03-26 07:07:40 +01:00
parent e8c2940ffb
commit 6ede7c0241
2 changed files with 29 additions and 0 deletions

14
usr/local/bin/autobackup.sh Executable file
View File

@@ -0,0 +1,14 @@
#! /usr/bin/bash
echo "mounting ${PARTUUID} to ${MOUNTPOINT}"
mount -t ext4 PARTUUID="${PARTUUID}" ${MOUNTPOINT}
if ! mountpoint -q ${MOUNTPOINT} ; then
echo "Backup Stick not mounted" >&2
exit 1
fi
echo "syncing ${SOURCE} to ${MOUNTPOINT}"
rsync -a -v -z --delete ${SOURCE} ${MOUNTPOINT}
umount ${MOUNTPOINT}