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

I need to automatically transfer files from windows server over to an Ubuntu server through FTP.

I control the ubuntu server and have no other access to the windows server but through FTP.

I need a command line ftp-sync program in ubuntu to check the ftp-folder on windows every 10 minutes and download all new files there and delete them from the windows server (or move to some other directory like 'completed') when download has been completed over to the ubuntu server.

share|improve this question

1 Answer 1

up vote 0 down vote accepted

Install curlftps:

apt-get install curlftpfs

and create a file ~/.netrc in the home directory of the user who should run this with the following content:

machine ftp.example.com login yourusername password yourpassword 

Then, write a script like the following:

#!/bin/bash
mkdir -p /mnt/ftp
curlftpfs ftp.example.com/yourtargetdir /mnt/ftp
rsync -a --delete-after  /mnt/ftp /yourlocaldir
fusermount -u /mnt/ftp

and put this script in cron job to run every ten minutes:

*/10 * * * * /path/to/your/script.sh
share|improve this answer
    
This looks like something I can use. Thank you. –  birgir Feb 28 '12 at 15:56

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.