Summary
SFTP=/usr/bin/sftp
DATE=/bin/date
DATE_OPTION='+%Y-%m-%d'
DATE_STR=`$DATE $DATE_OPTION`
BACKUP_SOURCE_HOST=example.com
BACKUP_SOURCE_PATH=/var/backups/example.com
BACKUP_SOURCE_SQL_FILE=${BACKUP_SOURCE_PATH}/example.com-FILE-${DATE_STR}.tar.gz
BACKUP_SOURCE_TAR_FILE=${BACKUP_SOURCE_PATH}/example.com-SQL-${DATE_STR}.gz
BACKUP_DEST_PATH=$HOME/Dropbox/backup
$SFTP $BACKUP_SOURCE_HOST << END
lcd $BACKUP_DEST_PATH
get $BACKUP_SOURCE_SQL_FILE
get $BACKUP_SOURCE_TAR_FILE
exit
END
echo "Backup finished"