Linux VPS下备份网站数据到ftp的一键脚本
人气:0#! /bin/bash
cd /home/www/deepvps
mysqldump –all-databases -uroot -ppass |gzip > mysql_backup.tar
tar -zcvf files_backup.tar.gz /home/www/deepvps/* –exclude=*.tar.gz
ftp -vn x.x.x.x << autoftp
user name pass
type binary
put mysql_backup.tar mysql_backup.tar
put files_backup.tar.gz files_backup.tar.gz
close
quit
autoftp
加载全部内容