Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Delete files from server after downloading using SFTP

by salva (Abbot)
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); }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1038401]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (7)
As of 2017-02-25 23:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (369 votes). Check out past polls.