jojo's blog--快樂憂傷都與你同在
          為夢想而來,為自由而生。 性情若水,風起水興,風息水止,故時而激蕩,時又清平……
          posts - 11,  comments - 30,  trackbacks - 0
          Hi All,
             
              I have written a Perl script, which deals with the ftp ing
          (transferring) the file to remote server and executing a Perl script
          (AUT) at remote m/c.

          The script is as below and here I have 2 doubts, so please help me to
          resolve this.
          1) I am getting the message like "could not transfer the file to
          server" but it is ftp ing the flie to remote m/c, and I can see that
          file ( root1.txt ) there.

          2) And I want to run the perl script (AUT) at remote m/c depending
          on the data we sent, so could you please let me know how can I achieve
          this.

          Is it possible for me to do system("test.pl"),  If I am at SFTP mode.
          Please see comment line in the code below.



          #!/usr/bin/perl -w

          use strict;
          use warnings;
          use Net::SFTP;

          my $server="A.BY.C.D";
          my $user="roserag";
          my $password="june@123";
          my %args = (user => "$user", password => "$password", ssh_args => []);
          $args{debug} = 1;
          $args{user} = "root";
          my $file="local.txt";
          my $rfile = "root1.txt";

          my $sftp=Net::SFTP->new($server, %args) or die "could not open
          connection to $server"n";
          $sftp->put($file,$rfile) or die " could not transfer the file to server
          "n";


          # system("test.pl");    Is this command work out.

          exit;


          [gaurav@testbrix Examples]$ perl sftp3.pl
          testbrix.wipro.com: Reading configuration data /home/gaurav/.ssh/config
          testbrix.wipro.com: Reading configuration data /etc/ssh_config
          ...................................
          ...................................
          testbrix.wipro.com: sftp: In write loop, got 510 offset 0
          testbrix.wipro.com: sftp: Sent message T:10 I:2
          testbrix.wipro.com: sftp: Sent message T:4 I:3
          could not transfer the file to server

          But I can see the file the file at server.


          Regards,
          XXX


          Please do not print this email unless it is absolutely necessary.
          The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments.
          WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.

          www.wipro.com

          posted on 2009-08-06 12:06 Blog of JoJo 閱讀(373) 評論(0)  編輯  收藏 所屬分類: 每日一記My Script

          <2025年6月>
          25262728293031
          1234567
          891011121314
          15161718192021
          22232425262728
          293012345

          常用鏈接

          留言簿(6)

          隨筆檔案

          文章分類

          文章檔案

          新聞分類

          新聞檔案

          相冊

          收藏夾

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 深水埗区| 曲阳县| 莱阳市| 庄河市| 卫辉市| 新安县| 泰来县| 松原市| 云南省| 正定县| 绥德县| 益阳市| 南昌县| 岳普湖县| 湟源县| 河南省| 彰化县| 滕州市| 富顺县| 兴海县| 乌兰浩特市| 台江县| 北票市| 桓仁| 南京市| 临清市| 五河县| 湖口县| 武陟县| 武强县| 青铜峡市| 宕昌县| 贵阳市| 区。| 卫辉市| 安顺市| 韶山市| 冕宁县| 新余市| 渝北区| 松江区|