LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to ftp files from one server to another server.... (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-ftp-files-from-one-server-to-another-server-941637/)

robi_cse2k 04-25-2012 05:19 AM

How to ftp files from one server to another server....
 
Every week under /var/tmp/BACKUP new file is generated..
the file size near about 10G.
file name like below...
backup_root_20120419_122234
backup_root_20120412_122234..

but i need to transfer those files to another server(/root_BACKUP/) weekly basis using ftp script automatically and delete the old files and keep only latest two files..

Can anyone help to make the script and mention the procedure also...

teckk 04-25-2012 09:13 AM

There are several ways to do that.
Here is some info. You'll have to make it how you want it.

http://linux.die.net/man/1/ftp
http://linux.die.net/man/1/crontab
http://steve-parker.org/sh/sh.shtml

Write a shell script with ftp transfering the files
http://www.commandlinefu.com/command.../sort-by-votes
Make the script executable
http://linux.die.net/man/1/chmod
Make a crontab that runs that script at the time you desire.
http://www.commandlinefu.com/command.../sort-by-votes
http://ubuntuforums.org/showthread.php?t=102626

If you want to delete old files you can use find with rm for example.
Or you could use a backup program
http://www.techrepublic.com/blog/10t...-utilities/895
http://linux.about.com/od/softbackup..._Solutions.htm

TB0ne 04-25-2012 09:19 AM

Outstanding answer, teckk.

teckk 04-25-2012 09:37 AM

Your welcome.

To the OP here are some more links
http://www.cyberciti.biz/tips/rotate...ll-script.html
http://www.overclock.net/t/1183361/b...ps-through-ftp
There appears to be lots of info posted on that.
http://www.google.com/search?q=backu...t%20with%20ftp

robi_cse2k 04-30-2012 06:13 PM

Good Job teckk.. Really helpful... thanks


All times are GMT -5. The time now is 12:38 PM.