Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Re: Removing files from remote server

by CountOrlok (Friar)
on Apr 22, 2013 at 13:52 UTC ( #1029878=note: print w/replies, xml ) Need Help??

in reply to Removing files from remote server

I would recommend debugging your script by first printing the ssh statement instead of putting it in backticks. This way you can verify what will be sent and once you are satisfied with that, you can put it in backticks. You will note that you are sending a bad command to the other server. You will also then figure out why you are getting a "could not resolve hostname" error.

There are a couple of issues with your files_DEL subroutine. my @LIB_FILES = shift is not going to do what you want. Remove that line and use @_ instead of @LIB_FILES. Running system inside your subroutine will run that command on your local computer. What you really intend to do is return a string like " && rm -fr lib1 && rm -fr lib2" to the caller which in turn will append it to the ssh command.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2018-06-24 21:40 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (126 votes). Check out past polls.