This commit is contained in:
2024-08-13 16:46:44 -04:00
commit 8cb37c6011
418 changed files with 69567 additions and 0 deletions

32
backend/systemWorker Executable file
View File

@@ -0,0 +1,32 @@
#!/bin/bash
while true
do
# test for Shutdown
if test -e "/faktotum/docker/data/socket/backup"; then
rm /faktotum/docker/data/socket/backup
shutdown now
fi
#test for USB stick
if test -e "/dev/disk/by-label/BACKUP-DATA"; then
echo "1" > /faktotum/docker/data/socket/stick
else
echo "0" > /faktotum/docker/data/socket/stick
fi
# create backup
if test -e "/faktotum/docker/data/socket/backup"; then
mount /dev/disk/by-label/BACKUP-DATA /mnt
name="/mnt/$(date '+%y-%m-%d_%H_%M')_backup.zip"
echo $name
zip -P 135798642 -r $name /faktotum/docker/data/database
umount /dev/disk/by-label/BACKUP-DATA
rm /faktotum/docker/data/socket/backup
echo "backup created"
fi
sleep 3
done