Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
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 having an uproarious good time at the Monastery: (19)
As of 2014-09-22 16:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (198 votes), past polls