stacks/homelab/sys-backup/run

15 lines
325 B
Plaintext
Raw Permalink Normal View History

2023-12-28 10:07:43 -07:00
#! /bin/sh
set -e
. /etc/lbu/lbu.conf
hostname=$(hostname)
mkdir -p /srv/backups/$hostname/
install -p -m 0600 /media/$LBU_MEDIA/$hostname.*.tar.gz /srv/backups/$hostname/
for path in /srv/backups/$hostname/$hostname.*.tar.gz; do
filename=$(basename $path)
[ -f /media/$LBU_MEDIA/$filename ] || rm $path
done
sleep 4h