FTP timed automatic upload file script (CentOS)

Source: Internet
Author: User
Tags ftp connection

 #!/bin/bash  ftp -n<<!open  192.168 . 220.129  user  ls   TOORBINARYHASHCD /path/to/BACKUPLCD / Path/to/need/backupprompt  mkdir  ' date  + " %y%m%d   "  ' CD '   Date  + %y%m%d   "  "mput  *closebye ! 

Open line-the host IP to be backed up to

User Line--ls is the username of the host to be backed up, toor the password for the front user

Binary lines-Transfer using binary mode

hash--each 1k size output A # number, can not

CD line-the directory to upload the backup file to

LCD line--backup files in the local directory

Prompt-----------to make the back mput upload multiple files without having to enter "yes" every time to confirm

mkdir line--In the backup host to create a backup directory by date, here is mainly to demonstrate this mode can and SSH generally use mkdir and anti-quotes

CD line-the directory to upload to the backup file

Mput--Upload all files under the Local directory folder, or write a specific file name

Close row--Closes the FTP connection

Bye line--Exit FTP

A daily backup is required, then a scheduled task can be

Reference:

http://blog.csdn.net/zzzzcs/article/details/23993165

FTP timed automatic upload file script (CentOS)

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.