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

I've been asked to code a method to move FTP files from 'many' directories to 'one'.

Files to be moved must be older than 15 minutes OR have completed their upload.

On my first pass at the problem I'm tackling the time-based variable first.

Getting the file in kermit is easy enough. I can even setup a variable based on time -15 minutes ...

#!/usr/local/bin/kermit +
(snip)
ftp open \%1 /user:\%2 /password:\%3
assign minus15z \fcvtdate(\v(timestamp) -00:15,3)
(snip)
ftp cd \%dir
ftp mget *

But I'm stuck on how to apply the variable 'minus15z' to the mget command.

It's obvious, I'm sure I'm just missing something easy.

share|improve this question
    
Does it have to be Kermit, which may not be sufficiently capable? Could you implement in, say, perl using Net::FTP? –  cjc May 16 '12 at 21:17
    
This is the sound of me smacking my forehead. I never even considered perl. I'm certainly not married to Kermit, just that's been handy in the past for tasks like this. So they said 'ftp' and 'moving files' and I thought 'kermit'. I'll crack open my perl book and give it a shot - thanks! –  Brian Dunbar May 17 '12 at 15:42
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.