By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,848 Members | 1,380 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,848 IT Pros & Developers. It's quick & easy.

to run a perl script from local machine that will login to remort servers and run a

P: 89
Dear friends,

how to make a perl script that will login to different remort servers and run a script from the local machine, in a defenite directory in the server that will update the server.


thanks in advance
rohit
Mar 18 '08 #1
Share this Question
Share on Google+
5 Replies


P: 89
Need urgent help...
please help me....
Mar 19 '08 #2

numberwhun
Expert Mod 2.5K+
P: 3,503
Need urgent help...
please help me....
Well, what have you coded so far to do this? What are you planning on using to log into the remote machine? (ie: SSH, Telenet, etc?)

Show us the code that you hve been working on and we will do what we can to assist you.

Regards,

Jeff
Mar 19 '08 #3

P: 89
Well, what have you coded so far to do this? What are you planning on using to log into the remote machine? (ie: SSH, Telenet, etc?)

Show us the code that you hve been working on and we will do what we can to assist you.

Regards,

Jeff
ok jef.
i am writing the code i plan....

>cd /home/user1
Expand|Select|Wrap|Line Numbers
  1. #!/usr/bin/perl
  2.  
  3. my $i = 1;
  4. my $add = "192.168.10.";
  5.  
  6. for( $i = 1, $i < 60, i++ ){
  7.  
  8. my $flg = `ssh "$add . $i"`;
  9.  
  10. ## say ssh donot required password as key-gen is already set, and i have ##exported to all machines.
  11.  
  12. if ($flg == 0){
  13.  
  14. # now i want to run a script on the remort machine's /etc/httpd, but the script in #on the local machine /home/user1.
  15.  
  16. }
  17.  
Mar 20 '08 #4

numberwhun
Expert Mod 2.5K+
P: 3,503
ok jef.
i am writing the code i plan....

>cd /home/user1
Expand|Select|Wrap|Line Numbers
  1. #!/usr/bin/perl
  2.  
  3. my $i = 1;
  4. my $add = "192.168.10.";
  5.  
  6. for( $i = 1, $i < 60, i++ ){
  7.  
  8. my $flg = `ssh "$add . $i"`;
  9.  
  10. ## say ssh donot required password as key-gen is already set, and i have ##exported to all machines.
  11.  
  12. if ($flg == 0){
  13.  
  14. # now i want to run a script on the remort machine's /etc/httpd, but the script in #on the local machine /home/user1.
  15.  
  16. }
  17.  
Personally, instead of trying to do all of this via a system() command, I think you should read up on using a module for the SSH. It would make things easier.

Regards,

Jeff
Mar 20 '08 #5

P: 89
Personally, instead of trying to do all of this via a system() command, I think you should read up on using a module for the SSH. It would make things easier.

Regards,

Jeff
thanks a lot.issue resolved...
Mar 24 '08 #6

Post your reply

Sign in to post your reply or Sign up for a free account.