backup-containers/backup/backup.sh
2024-07-02 22:13:03 -07:00

11 lines
223 B
Bash

#!/bin/bash
source /.env
FILENAME="$NAME $(date +%Y-%m-%d\ %H-%M).tgz"
# tar volumes
tar -aczf /tmp/$FILENAME -C /volumes .
# ship to host
rsync -R -e "ssh -i /id" /tmp/$FILENAME $NAME@$HOST:/home/$NAME/$(date +%Y\/%m)/