please
This commit is contained in:
parent
77998dde1d
commit
75d3735f1c
|
@ -3,13 +3,13 @@
|
||||||
source /.env
|
source /.env
|
||||||
|
|
||||||
FILENAME="$NAME $(date +%Y-%m-%d\ %H-%M).tgz"
|
FILENAME="$NAME $(date +%Y-%m-%d\ %H-%M).tgz"
|
||||||
DIRNAME="/tmp/$(date +%Y\/%m)"
|
DIRNAME="$(date +%Y\/%m)"
|
||||||
# tar volumes
|
# tar volumes
|
||||||
tar -aczf "$DIRNAME/$FILENAME" -C /volumes .
|
tar -aczf "/tmp/$FILENAME" -C /volumes .
|
||||||
|
|
||||||
# ship to host
|
# ship to host
|
||||||
cd /tmp
|
ssh -i id $NAME@$HOST mkdir -p /home/$NAME/$DIRNAME/
|
||||||
rsync -r -e "ssh -i /id" . $NAME@$HOST:/home/$NAME/
|
rsync -r -e "ssh -i /id" "/tmp/$FILENAME" $NAME@$HOST:/home/$NAME/$DIRNAME/$FILENAME
|
||||||
|
|
||||||
# delete backup
|
# delete backup
|
||||||
rm -rf $DIRNAME
|
rm -rf "/tmp/$FILENAME"
|
Loading…
Reference in a new issue