Re: [Ssh-sftp-perl-users] Executing Command FIles (KSH) not Simply One-line Commands
Brought to you by:
dbrobins
From: Bryan B. <br...@bu...> - 2006-04-14 13:37:52
|
> I'm running into a situation here where I need to connect to remote > servers using this module and be able to execute kron shell file commands > i.e. .ksh. The idea here is to be able to do it while these ksh files are > residing locally where the perl code is run and not on the remote servers. > This is to centralized the code all in one location. > - Can this be done? > - If not, can any one suggest workarounds or other solutions? > - How do admins manage the code that needs to run on 100's of remote > servers ? > Its pretty simple, load the entire shell file into a scalar variable, and run that as a command over the channel. If you use return codes to check the result its even more trivial as Net::SSH2 and/or Net::SSH::Perl gives you the return code of the channel. Hope that helps. Bryan http://sourceforge.net/projects/rover |