(转自村子lts98) http://www.phpx.com/happy/top94529.html
加上了中文注释,有问题大家一起讨论。 #!/bin/bash host=202.100.222.2 #FTP主机 UserName=test #FTP用户名 Passwd=test #FTP密码
function Iint() #处理涵数 { backup_path=/home/mysqlbackup #压缩文件存放的目录 file=$path-mysql-$(date +%Y-%m-%d).tar.gz #文件名 backupCWD=/usr/local/mysql/data/$path #需备份的path tar -czf $backup_path/$file $backupCWD #执行备份操作
cd $backup_path
ftp -i -n
rm -rf $backup_path/*.tar.gz #删除压缩文件 echo “ftp back ok!”
No Responses (yet)
Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.