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.