For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > February 2005 > Looking for a mirror script (sorta)









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Looking for a mirror script (sorta)
Dan Fish

2005-02-24, 8:55 pm

I'm looking for a script that I can set up to periodically poll an ftp site,
download all available files in a specified directory, and then delete the
remote files. (Sorta like a mirror script with remote delete)

AFAIK you can't delete remote files with mirror-2.9, which seemed to be the
case with all the other "mirror-type" scripts that showed up during a web
search.

rsync won't work because I ONLY have ftp access... No rsh/ssh... (But I DO
have read/write/delete ftp access)

I'm sure I could hack something together using Net::FTP, but I thought I'd
just check and see if anybody has a pointer to a battle-tested script before
I re-invent the proverbial wheel...

Thanks,
-Dan

---
Dan Fish - seadancr@mapson.cox.net
(remove REVERSE("nospam") above to reply via email... The spambots are
smart enough nowadays to remove a "nospam" for you...:-)


Chris Devers

2005-02-24, 8:55 pm

On Thu, 24 Feb 2005, Dan Fish wrote:

> I'm looking for a script that I can set up to periodically poll an ftp site,
> download all available files in a specified directory, and then delete the
> remote files. (Sorta like a mirror script with remote delete)


Have you looked at ncftp? The `ncftpget` tool looks useful for you:

$ ncftpget --help | egrep -i 'delete|recurs'
-DD Delete remote file after successfully downloading it.
-R Recursive mode; copy whole directory trees.
-T Do not try to use TAR mode with Recursive mode.
$

This should become a one line cron job now.



--
Chris Devers
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com