I want to backup all the files on the live server to keep on my backup server. How I can do this ?
I prefer lftp to do this. Using lftp we can either synchronize the local files to a remote location or wise versa.
1. How do I syncronise the a folder on a FTP location to my local Linux server.
Suppose these are my remote ftp details:
FTP : 208.74.34.93
User: user
Password : pass
Ftp backup folder: securedata
[root@web-test1 ~]# yum install lftp*
Then
#lftp -u user,pass -e "mirror --delete --only-newer --verbose /securedata /Backup/local/webfiles" 208.74.34.93</code>
I simply create script file and add this to a daily cron job,
[root@rc-040 scripts]# crontab -l
10 12 * * * /bin/sh /home/installation/scripts/marketbkp.sh
Second one is, copying the local files and upload to a remote ftp location. Just append the word "--reverse" to the existing command line path.
#lftp -u user,pass -e "mirror --reverse --delete --only-newer --verbose /securedata /Backup/local/webfiles" 208.74.34.93
Which would upload/synchronize all the files from the locally and upload to the remote location. This would be very helpful in case of disaster management. I do create a script for this.