Linux FTP automatic Landing download backup, upload file script

Source: Internet
Author: User

Using a remote server, FTP operations on another remote server are much faster than local machine operations.

Previously wrote an article about how FTP is manually remotely operated on Linux,

Today I found an automated batch script that feels good. Meet my needs.

My a site in Hong Kong my B server Linux in the country. This allows the a site to be automatically backed up to B server.

Hope this blog can give the students in need some help.

# # # # # # #从ftp服务器上的/home/data to the local/home/databackup####

#!/bin/bash ftp-n<<! Open 192.168.1.171user guest 123456 binary cd/home/data lcd/home/databackup prompt mget * Close bye!




2. FTP automatically log in to upload files.


# # # #本地的/home/data#### on/home/databackup to FTP server





Open 192.168.1.171





Hash













!





3. FTP automatic login to download a single file.


# # # #ftp服务器上下载/home/data/a.sh to local/home/databackup####





Open 192.168.1.171

















!




4. FTP automatic login to upload a single file.


# # # #把本地/home/databachup/a.sh up Ftp/home/databackup # # # #





Open 192.168.1.171

















!


Summary: Save the above script as a file added to the crontab to enable FTP to automatically upload, download files.
Starting at http://java-er.com-http://java-er.com/blog/linux-ftp-auto-backup/

See no regrets, eight tips for learning programming
30 Java face questions you will encounter
Tetris design principles
Android Tutorial two: Android Engineering file description Daquan
Java high-performance programming 26 considerations
A foreign net earns five blogging suggestions

Related Article

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.