需求:自动备份网站数据文件到七牛

    os      : CentOS release 6.5 (Final)
    website : /opt/website
    MySQL   : /opt/mysql
    backup  : /opt/backup
    qshell  : /opt/qshell

备份网站文件

vim /opt/website.sh

#!/bin/sh
# tar /opt/website to /opt/backup/website

mkdir -p /opt/backup/website
t=`date +"%Y%m%d_%H%M%s"`
tar -zcvf /opt/backup/website/$t.tar.gz /opt/website

chmod u+x website.sh

备份MySQL文件

- 阅读剩余部分 -