Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

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]
[LanX]: hmm this joke may be too old for millennials
[LanX]: s/joke/reference/
[Eily]: well, I didn't get the joke and I didn't get the image either because the proxy won't let me
[erix]: Leasure Suit L.
[LanX]: THEY are restricting your Internet?
[LanX]: join the fight brother

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (15)
As of 2017-03-23 17:44 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (292 votes). Check out past polls.