<![CDATA[Latest posts for the topic "Script backup: chạy trực tiếp & cron khác nhau"]]> /hvaonline/posts/list/24.html JForum - http://www.jforum.net Script backup: chạy trực tiếp & cron khác nhau Code:
[root@mail backup]# ll -tsh
total 8.2G
2.7G -rw-r--r--  1 root root 2.7G Jun 12 07:13 2013-06-12.zimbra.tgz
8.0K -rw-r--r--  1 root root   20 Jun  8 22:25 2013-06-08.zimbra.tgz
8.0K -rw-r--r--  1 root root   20 Jun  1 22:23 2013-06-01.zimbra.tgz
2.0G -rw-r--r--  1 root root 2.0G May 30 22:02 2013-05-30.zimbra.tgz
8.0K -rw-r--r--  1 root root   20 May 25 23:05 2013-05-25.zimbra.tgz
1.3G -rw-r--r--  1 root root 1.3G May 22 11:26 2013-05-22.zimbra.tgz
1.3G -rw-r--r--  1 root root 1.3G May 21 11:25 2013-05-21.zimbra.tgz
1.2G -rw-r--r--  1 root root 1.2G May 20 22:12 2013-05-20.zimbra.tgz
8.0K drwxr-xr-x 51 root root 4.0K May 13 17:33 zimbra
[root@mail backup]# crontab -l
22 22 * * 6 /root/tools/backup.sh
[root@mail backup]#
Còn đây là nội dung của file backup
[root@mail backup]# cat /root/tools/backup.sh # Stop Zimbra Services su - zimbra -c "zmcontrol stop" #sleep 20 # Sync to backup directory rsync -avHK --delete /opt/zimbra/ /media/backup/zimbra # Restart Zimbra Services su - zimbra -c "zmcontrol start" # Create archive of backed-up directory for offsite transfer # cd /backup/zimbra tar -zcvf /media/backup/$(date +%Y-%m-%d).zimbra.tgz /media/backup/zimbra/*  
]]>
/hvaonline/posts/list/44837.html#276527 /hvaonline/posts/list/44837.html#276527 GMT
Script backup: chạy trực tiếp & cron khác nhau su - zimbra -c"/opt/zimbra/bin/zmcontrol stop" sleep 15 kill -9 `ps -u zimbra -o "pid="`  ]]> /hvaonline/posts/list/44837.html#276540 /hvaonline/posts/list/44837.html#276540 GMT Script backup: chạy trực tiếp & cron khác nhau /hvaonline/posts/list/44837.html#276550 /hvaonline/posts/list/44837.html#276550 GMT Script backup: chạy trực tiếp & cron khác nhau /hvaonline/posts/list/44837.html#276555 /hvaonline/posts/list/44837.html#276555 GMT