Linux VPS下备份网站数据到ftp的一键脚本
发布时间:2016-12-27 来源:查字典编辑
摘要:#!/bin/bashcd/home/www/deepvpsmysqldump–all-databases-uroot-ppas...
#! /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