DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/)
-   Existing Scripts (http://www.daniweb.com/forums/forum145.html)
-   -   Directory Download Script (http://www.daniweb.com/forums/thread104387.html)

mjgelinas Jan 11th, 2008 8:33 am
Directory Download Script
 
Hello,

Wondering if anyone knows of a certain script / solution...

I need a script that will download all the files from an FTP server recursively to the local machine and delete the files and folders from the FTP server after it downloads each one. This script will run every 15 minutes via cron.

Originally I was going to use wget to get the directory tree that I need but as far as I see it does not delete files from the server after downloading them. (it does delete files locally after downloading them with --delete-after)

The script will be running on a Mac with OS X 10.2 so anything unix based should work.

I would really appreciate some help as I am currently at a loss. I only know basic shell scripting myself :S

Thanks.
Marcel

mjgelinas Jan 11th, 2008 10:52 am
Re: Directory Download Script
 
I built ncftp on my system and it works great for doing this.

Just add this to the crontab:

ncftpget -u [user] -p [password] -R -DD [host] [local dir] [remote files]

Thanks


All times are GMT -4. The time now is 11:20 pm.

Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC