Linux automatically uploads backup files

Source: Internet
Author: User

Linux automatically uploads a backup file and uses sftp to automatically back up important data to the target server. 1. Prepare www.2cto.com to install lftp yum install lsfp. 2. Create the execution file bak. sh #! /Bin/shcd/usr/local/bakfile/tar-zcvf bakfile.tar.gz bakfileHOST = 192.168.0.3 USER = rootPASS = centos echo "Starting bak File... "lftp-u $ {USER}, $ {PASS} sftp: /// $ {HOST} <EOFcd/usr/bak/LCD/usr/local/bakfile/put bakfile.tar.gz exitEOFecho "Done" 3. join the scheduled task www.2cto.com> crontab-e> 0 1 ** 1/usr/lcoal/bakbin/bak. sh is automatically executed at every week ------------------------------------- task plan Note: Time: *****/bin. sh & in the order of hours, days, months, weeks, 1, 2, 3, 4 * indicates, January 1, April 3 */10 * indicates that 0 1-5 is executed every 10 minutes ** * indicates that the execution is performed at, every day, and '&' is added to the execution file to indicate that the execution is performed in the background.

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.