Перед тем, как настроить бекапы следует разрулить ключи между сервером и StorageBox
#/bin/bash srv=uXXXXX@uXXXXX.your-storagebox.de mysqlpass='MySQLpaSSw0rd' srv_path='/home/db_backups_site' DbList="db1 db2 db3 db4 db5 db77" #-- LOG=/var/log/dump-db-to-hetzner.log log(){ echo "$(date '+%F %T') $@" >> $LOG; } log "start>>>" day=$(date +%u) from=$(ip a |grep -w inet |grep -v 127.0.0.1|awk '{print $2}'|sed 's|\.|-|g' |sed 's|\/.*||') for db in $DBList; do file=${day}_${db}-sql.gz echo -n "Create dump $file..";log "Create dump $file" mysqldump -u root -p$mysqlpass --add-drop-table --insert-ignore \ --skip-lock-tables --single-transaction=TRUE -B $db 2>/dev/null|gzip > /bcp/$file echo -n "..copy $file to StorageBox $file .."; log "Copy $file to StorageBox $file" scp -P23 -q /bcp/$file $srv:$srv_path/${file} echo '.done'; done log "end"