Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 01-15-2006, 10:44 PM   #1
Registered: Dec 2003
Location: Boston, MA
Distribution: Redhat / Debian
Posts: 269

Rep: Reputation: 30
Automating an FTP transfer with cron?

Hi all,

I have a cron job setup that automatically backs up mysql databases on a Fedora server that I have rack hosted.

At home, I have a linux box that I use for a fileserver that I never turn off.

Is it possible to setup a cron job at home to have my fileserver connect via FTP to my remote server and download the backups?

I've tried man ftp, but it's not really showing me how to go about it. Any insight would really be appreciated.

Doing it with SSH isn't an option currently (I have to pay extra to get it enabled at my host), but if that's the only way, that'd be helpful as well.


Last edited by Seventh; 01-15-2006 at 10:46 PM.
Old 01-16-2006, 12:10 AM   #2
Senior Member
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,289

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
It is possible. There's a little scripting toolkit called expect that let's you script things like entering FTP passwords. Documentation is available. Alternatively you could use rcp (remote copy), but it's very insecure if not configured correctly -- I'd stay away from it if it were me -- I'm mentioning it mostly for completely.
Old 01-16-2006, 03:25 AM   #3
Senior Member
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
"expect" is indeed a great, general toolkit for handling any interactivity (such as entering passwords).

However, I would recommend using a tool like "wget" in this case.
I've been using it for months for my automatic downloads, without any problems.

It can do things like:
-http/ftp logins
-recursive downloads of entire directory trees
-continuation of failed downloads
-only downloading files that have changed since last download
Old 01-17-2006, 07:39 PM   #4
Registered: Dec 2003
Location: Boston, MA
Distribution: Redhat / Debian
Posts: 269

Original Poster
Rep: Reputation: 30
You know, I never even considered using wget. Thanks very much guys!


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
Trouble when automating ftp with shell script hari_s_82 Linux - Newbie 2 09-23-2004 03:17 AM
Can I make a Cron job to synch/transfer a file from a folder to another FTP?... read efishta Linux - General 6 07-19-2003 11:03 PM
FTP Data transfer yaliou Linux - Networking 4 06-28-2003 08:37 AM
FTP Script (Automating) noodle123 Linux - General 2 10-16-2002 09:17 AM
Automating an ftp and mail job saavik Linux - Networking 12 07-09-2002 06:22 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:25 PM.

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