Let's get to the point. The company now has 2 servers, are CentOS systems, a local (LAN), a computer in the telecommunications room. Because the work needs, the daily backup room data to the local, has been FTP login, and then downloaded to the local machine. Now hope, using the local CentOS machine, Automatic backup to Local.
The workaround is as follows:
1. Download the data that has been packaged on the machine in the remote telecommunication room. This is not difficult, a statement to fix.
The code is as follows |
Copy Code |
wget Ftp://user_name:password@ip_address:port/dir/file_name |
2. Timed tasks, you need to write a script, and join the scheduled task.
A. Script. Suppose you plan to back up your remote files to the/var/www/html/back directory, and under this directory, create a new file that reads
The code is as follows |
Copy Code |
!#/bin/sh cd/var/www/html/back/ |
wget FTP (the above statement) is saved as bak.sh
B. Join a timed task. Direct Vi/etc/crontab Add the following statement on the last line
The code is as follows |
Copy Code |
* * * * root/var/www/html/back/bak.sh |
(where the script is saved) The local CentOS machine automatically backs up remote FTP files to/var/www/html/back every 6:30.
PS: The technical details involved in this article are limited to a variety of factors. You can search the next, welcome to my message, Q me.
Recommended article: CentOS scheduled backup data to remote FTP files