新闻中心

备份qmail的一个脚本

 #!/bin/sh
cd /var/qmailbak
DATE=`date +%Y-%m-%d-%H`
echo "#### Start backup qmail####"
mkdir $DATE
cd $DATE
tar cvfz domains.tar.gz /usr/local/vpopmail/domains
tar cvfz control.tar.gz /var/qmail/control
tar cvfz vpopmail_sql.tar.gz /var/db/mysql/vpopmail
echo "###backup completely###"
echo "###start ftp####"
ftp -n 10.230.16.130 <<!
user dillon 0405amat
binary
mkdir $DATE
cd $DATE
put domains.tar.gz
put control.tar.gz
put vpopmail_sql.tar.gz
bye
!
echo "###finish####"

香港云主机