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?
-
Did you try googling this before asking all of us to help you? How about using that chance to shame the company that forces you to still use an insecure protocol? – chicks Jun 07 '16 at 17:53
-
Possible duplicate of [Cron Job for FTP download](http://serverfault.com/questions/157515/cron-job-for-ftp-download) – chicks Jun 07 '16 at 17:53
10 Answers
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.

- 2,532
- 20
- 16
-
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 03 '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 03 '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 03 '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. – OtherDevOpsGene Jun 04 '09 at 12:11
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.

- 2,622
- 6
- 38
- 55
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.

- 964
- 8
- 9
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

- 1,221
- 7
- 15
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.

- 14,293
- 7
- 49
- 78
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.

- 31,471
- 65
- 192
- 253
Another way is to create a bash script like this:
#! /bin/bash
ftp -n << 'EOF'
open ftp.your_ftp_host.com
quote USER your_username_here
quote PASS your_password_here
cd gets
prompt no
mget *.txt .
bye
EOF

- 111
- 3