LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-25-2012, 05:19 AM   #1
robi_cse2k
LQ Newbie
 
Registered: Apr 2012
Posts: 2

Rep: Reputation: Disabled
Lightbulb 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...
 
Old 04-25-2012, 09:13 AM   #2
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,384
Blog Entries: 7

Rep: Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946
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

Last edited by teckk; 04-25-2012 at 09:14 AM.
 
1 members found this post helpful.
Old 04-25-2012, 09:19 AM   #3
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 27,594

Rep: Reputation: 8136Reputation: 8136Reputation: 8136Reputation: 8136Reputation: 8136Reputation: 8136Reputation: 8136Reputation: 8136Reputation: 8136Reputation: 8136Reputation: 8136
Outstanding answer, teckk.
 
Old 04-25-2012, 09:37 AM   #4
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,384
Blog Entries: 7

Rep: Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946
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
 
Old 04-30-2012, 06:13 PM   #5
robi_cse2k
LQ Newbie
 
Registered: Apr 2012
Posts: 2

Original Poster
Rep: Reputation: Disabled
Good Job teckk.. Really helpful... thanks
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to monitor web server, FTP server, Mail server and database server vodka33us Programming 1 06-16-2008 04:20 AM
files not visible in ftp site (but present in the /var/ftp/folder of the server) dongrila Linux - Newbie 2 12-23-2007 10:09 PM
LXer: Backup MySQL databases, web server files to a FTP server automatically LXer Syndicated Linux News 0 08-11-2006 09:54 PM
ftp server - Pure ftp - logs in OK but no files visible tp11235 Linux - Networking 2 08-30-2005 05:11 AM
how can I restrict ftp users listing files from a pure-ftp server adrianmak Linux - Networking 2 12-31-2002 08:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:16 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration