For ease of management, we can hang Windows shared folders under Linux so that the backed-up data can be viewed at any time through windows, and the corresponding scheduled tasks are made for the script to run automatically.
1. Mount Windows share to/mnt/share
[Root@game-syslog-o/]mount-t Cifs-o
Username=switchbackup@game-inc.com,password=p@ssw0rd
192.168.36.74/backup/mnt/share
2. Edit rc.local automatically mount Windows share
[Root@game-syslog-o/]vi/etc/rc.local
Mount-t Cifs-o username=switchbackup@game-inc.com,password=p@ssw0rd//192.168.36.74/backup/mnt/share/
More Wonderful content: http://www.bianceng.cnhttp://www.bianceng.cn/Network/jhjs/
3. Edit Crontab Schedule Task
[Root@game-syslog-o/]crontab-e
2 * * * * cd/opt &&/bin/sh-x tar.sh #脚本存放在opt目录下, daily 2:00
3 * * */bin/cp-rf/opt/tftp/*.tar.gz/mnt/share/switch/
0 1 * */bin/rm-rf/mnt/share/switch/*.tar.gz
1 1 * */bin/rm-rf/opt/tftp/*.tar.gz
Complete the whole ~
This article from the "Wang 11" blog, please be sure to retain this source http://wangshiyi.blog.51cto.com/703685/1122984