LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Automating an FTP transfer with cron? (https://www.linuxquestions.org/questions/linux-newbie-8/automating-an-ftp-transfer-with-cron-403797/)

Seventh 01-15-2006 09:44 PM

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.

Thanks!

btmiller 01-15-2006 11:10 PM

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.

timmeke 01-16-2006 02:25 AM

"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
-etc.

Seventh 01-17-2006 06:39 PM

You know, I never even considered using wget. Thanks very much guys! :)


All times are GMT -5. The time now is 01:34 AM.