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