Download and then Delete all files via Command Line

Core FTP client questions and answers
Post Reply
daved
Posts: 7
Joined: Tue Apr 28, 2009 1:40 pm

Download and then Delete all files via Command Line

Post by daved »

Agh! Why can't I start a new thread?!

-edit- Sorry for the doubling up here, was having some odd problems trying to start a new thread. Each time I'd submit it would tell me the thread was posted, and provide a link to it. Following the link would tell me there was no such thread, and it wouldn't show up in the forum list.
Last edited by daved on Tue Apr 28, 2009 3:33 pm, edited 2 times in total.
daved
Posts: 7
Joined: Tue Apr 28, 2009 1:40 pm

Post by daved »

[b]Background:[/b]
Periodically we have files which are loaded to an FTP server by an outside source. A regularly scheduled job needs to connect to this FTP server, pull down the latest file, and process it. So I either need to pull just the latest file matching a name (*.txt), or pull all of the files matching a name and then delete those files from the FTP (so that the next time the command runs, "get all files" should == "get latest file" == "get only file")
Okay, that was weird. Tried posting this 3 times before, and it kept telling me it was posted successfully, but then that there was no such thread. Here's what I've been trying to post:


Current:
Based on the example at http://www.coreftp.com/docs/web1/Command_Line_FTP.htm , I am using the following command to download all of the files in the FTP dir:

>coreftp.exe -s -O -site StoredSiteName -d /*.txt -p V:\localDir\

This works great for pulling all files down, but the files remain on the FTP server.

Other:
I see that there is an -OS option (instead of -O) to skip any existing files, but the afore-mentioned local processing job moves all input files, meaning the destination directory (V:\localDir) should always be empty before this command executes.
daved
Posts: 7
Joined: Tue Apr 28, 2009 1:40 pm

Post by daved »

Works perfectly, thanks!

Is there a reference page somewhere that lists this that I missed?
Post Reply