This commit is contained in:
May 2024-07-03 00:13:58 -07:00
parent 77998dde1d
commit 75d3735f1c
Signed by: split
GPG key ID: C325C61F0BF517C0

View file

@ -3,13 +3,13 @@
source /.env
FILENAME="$NAME $(date +%Y-%m-%d\ %H-%M).tgz"
DIRNAME="/tmp/$(date +%Y\/%m)"
DIRNAME="$(date +%Y\/%m)"
# tar volumes
tar -aczf "$DIRNAME/$FILENAME" -C /volumes .
tar -aczf "/tmp/$FILENAME" -C /volumes .
# ship to host
cd /tmp
rsync -r -e "ssh -i /id" . $NAME@$HOST:/home/$NAME/
ssh -i id $NAME@$HOST mkdir -p /home/$NAME/$DIRNAME/
rsync -r -e "ssh -i /id" "/tmp/$FILENAME" $NAME@$HOST:/home/$NAME/$DIRNAME/$FILENAME
# delete backup
rm -rf $DIRNAME
rm -rf "/tmp/$FILENAME"