Beefy Boxes and Bandwidth Generously Provided by pair Networks DiBona
No such thing as a small change
 
PerlMonks  

Re: Delete files from server after downloading using SFTP

by salva (Monsignor)
on Jun 12, 2013 at 07:50 UTC ( #1038401=note: print w/ replies, xml ) Need Help??


in reply to Delete files from server after downloading using SFTP

my $sftp = new Net::SFTP::Foreign(host => $host, user => $user, passwo +rd => $pwd, more => '-v', autodie => 1); $sftp->setcwd('/directory'); my $files = $sftp->glob('*.txt', names_only => 1); for my $file (@$files) { $sftp->get($file, "/in_dir/$file", numbered => 1); $sftp->remove($file); }


Comment on Re: Delete files from server after downloading using SFTP
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1038401]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2014-04-19 15:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (483 votes), past polls