Sunday, July 16, 2017

backup sites with cront and ssh

# m h dom mon dow command

33 0 * * *   /usr/bin/ssh root@lunch-break.ro "/bin/tar czf - /home/www/bla " > \
 /home/emilper/backup/bla/www_bla_`date +\%Y-\%m-\%d_\%H-\%M-\%S`.tar.gz 2>>/tmp/cron.log 
52 0 * * *   /usr/bin/ssh root@lunch-break.ro "mysqldump -u root -pblabla --opt bla_db | \
 gzip -9c " > /home/emilper/backup/bla/bla_db_mysql_dump_`date +\%Y-\%m-\%d_\%H-\%M-\%S`.gz \
 2>>/tmp/cron.log 

No comments:

Post a Comment