please
This commit is contained in:
parent
77998dde1d
commit
75d3735f1c
|
@ -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"
|
Loading…
Reference in a new issue