How to use expect script to implement backup Huawei switch configuration (iv)

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.