Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Some company use FTP to publish the updates that we need from then, is there a software to automatize that? or i will to bash-script the process? any ideas?

share|improve this question
add comment

9 Answers

up vote 3 down vote accepted

There are lots of good suggestions. Also check out wget or curl.

share|improve this answer
add comment

You'll probably have to bash-script it, but wrap it around ncftpget and/or ncftpput as that will let you get or put files from the command line.

share|improve this answer
add comment

If you are looking to automatically download whatever is published to an FTP site, you could use rsync, running it as a cron job:

rsync -P -v -r ftp.nluug.nl::Mandrakelinux/official/2006.0/i586/install/images/ .

See http://www.brunolinux.com/10-General_Info/Rsync.html for more information about rsync.

share|improve this answer
    
Doesn't the site need to be running a rsync server? Many public ftp servers also offer http/rsync, but I am not sure that 'some company' will. –  Zoredache Jun 3 '09 at 17:32
    
The remote site is running on Win2k3+FTP via IIS and we have an username and password, does this matter? –  Ariel Antigua Jun 3 '09 at 17:41
    
Yes, it does. IIS will not support rsync out of the box. Rsync is a good solution for speeding up data syncronization, but it requires a client/server setup to work. –  Avery Payne Jun 3 '09 at 19:09
    
If this isn't Linux as originally tagged, then rsync is not a good choice. One of the wget/curl/ncftpget answers makes more sense then. –  CoverosGene Jun 4 '09 at 12:11
add comment

Quickly

open ftp.address.co.uk
quote USER username
quote PASS password
cd ftp/dir
put file
bye

you can then run ftp -n < backup.sh, where backup.sh is the code above. I wrote some fancy create folders with todays date before running the ftp command. If anyones interested I can post them up here.

share|improve this answer
add comment

Agree that rsync is good, but an alternative is lftp. It has automated and interactive shell-like modes, and supports options that make mirroring simple.

share|improve this answer
add comment

I've used ncftpget

to script ftp gets.

share|improve this answer
add comment

I use a python script for this purpose, you can easly implement ini files for the script and if you want to schedule it under windows you can build an exe with py2exe. Youcan grab a sample code here.

share|improve this answer
add comment

ftpcopy used to be my quick choice for mirroring:

ftpcopy is a simple FTP client written to copy files or directories (recursively) from an FTP server. It was written to mirror FTP sites which support the EPLF directory listing format, but it also supports the traditional listing format (/bin/ls). . ftpls is an FTP client which generates directory listings, either in plain text or HTML. . The tools only support passive mode FTP. There is no plan to support active mode. . See http://www.ohse.de/uwe/ftpcopy.html for more information. Bugs: mailto:ubuntu-users@lists.ubuntu.com Origin: Ubuntu

share|improve this answer
add comment

wget can download recursivly using the -r (recrusive) or -m (mirror) options. Check the man page for more information.

You could write a bash script, but you probably don't need to. You could just put the wget command line into a cron and it'll be executed regularly.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.