Professional Web Applications Themes

Net::SCP::Expect - PERL Beginners

Would someone mind telling me what I am doing wrong here please. I am trying to tie the SCP Expect module into a backup script I put together, but it keeps failing. I stripped out all but the SCP example code and it still generates an error from the module. I verified my login, directory and filenames were correct by sending the file manually. I am running Perl v5.8.0, Expect-1.14, and Net-SCP-Expect-0.10 ===The script=========== #!/usr/bin/perl -w use strict; use Net::SCP::Expect; my $host = "host.whatever"; my $user = "josem"; my $pwd = "password"; my $scp = Net::SCP::Expect->new(host=>$host,user=>$user,password=>$pwd); $scp->scp("[backup.tar]","[/home/josem]"); exit 0; ===The ...

  1. #1

    Default Net::SCP::Expect

    Would someone mind telling me what I am doing wrong here please. I am trying to tie the SCP Expect module into a backup script I put together, but it keeps failing. I stripped out all but the SCP example code and it still generates an error from the module. I verified my login, directory and filenames were correct by sending the file manually.

    I am running Perl v5.8.0, Expect-1.14, and Net-SCP-Expect-0.10

    ===The script===========
    #!/usr/bin/perl -w
    use strict;
    use Net::SCP::Expect;
    my $host = "host.whatever";
    my $user = "josem";
    my $pwd = "password";
    my $scp = Net::SCP::Expect->new(host=>$host,user=>$user,password=>$pwd);
    $scp->scp("[backup.tar]","[/home/josem]");
    exit 0;


    ===The error===========
    josem $./script3.pl
    at /usr/lib/perl5/site_perl/5.8.0/Expect.pm line 730ease try again.


    ===Line 730 from Expect.pm===========
    725 if ($#{$pattern} > 3) {
    726 # call with parameters if given
    727 $exp_cont = &{$pattern->[3]}($exp,
    728 {$pattern}[4..$#{$pattern}]);
    729 } else {
    730 $exp_cont = &{$pattern->[3]}($exp);
    731 }


    Any help would be greatly appreciated!

    Thanks,
    Jose
    Jose Malacara Guest

  2. #2

    Default Fw: Net::SCP::Expect

    Sorry if this comes across twice. It bounced back the first time...


    Would someone mind telling me what I am doing wrong here please. I am trying to tie the SCP Expect module into a backup script I put together, but it keeps failing. I stripped out all but the SCP example code and it still generates an error from the module. I verified my login, directory and filenames were correct by sending the file manually.

    I am running Perl v5.8.0, Expect-1.14, and Net-SCP-Expect-0.10

    #The Script
    #!/usr/bin/perl -w
    use strict;
    use Net::SCP::Expect;
    my $host = "host.whatever";
    my $user = "josem";
    my $pwd = "password";
    my $scp = Net::SCP::Expect->new(host=>$host,user=>$user,password=>$pwd);
    $scp->scp("[backup.tar]","[/home/josem]");
    exit 0;


    #The error
    josem $./script3.pl
    at /usr/lib/perl5/site_perl/5.8.0/Expect.pm line 730ease try again.


    #Line 730 from Expect.pm
    725 if ($#{$pattern} > 3) {
    726 # call with parameters if given
    727 $exp_cont = &{$pattern->[3]}($exp,
    728 {$pattern}[4..$#{$pattern}]);
    729 } else {
    730 $exp_cont = &{$pattern->[3]}($exp);
    731 }


    Any help would be greatly appreciated!

    Thanks,
    Jose
    Jose Malacara Guest

  3. #3

    Default RE: Fw: Net::SCP::Expect

    Perhaps you should automate ssh logins by using a key that requires no
    passphrase, in other words so you can just "ssh usernamehostname" and
    you're in with no interaction required. Then you don't need expect for
    that.
    Also, have you tried using the hostname IP address, just to see what
    happens?

    -tristram

    Tn Guest

  4. #4

    Default Re: Fw: Net::SCP::Expect

    I have tried IP address as well and get the same error message. I have
    considered alternate ways of doing this, but now I'm bent on figuring out
    why this isn't working for me!

    Thanks for the input.

    Jose

    ----- Original Message -----
    From: "TN" <tneldan.cc>
    To: "'Jose Malacara'" <josemthrifty.net>; "'R. Joseph Newton'"
    <rjnewtonefn.org>
    Cc: <beginnersperl.org>
    Sent: Wednesday, October 01, 2003 9:59 AM
    Subject: RE: Fw: Net::SCP::Expect

    > Perhaps you should automate ssh logins by using a key that requires no
    > passphrase, in other words so you can just "ssh usernamehostname" and
    > you're in with no interaction required. Then you don't need expect for
    > that.
    > Also, have you tried using the hostname IP address, just to see what
    > happens?
    >
    > -tristram
    >
    >
    > --
    > To unsubscribe, e-mail: [email]beginners-unsubscribeperl.org[/email]
    > For additional commands, e-mail: [email]beginners-helpperl.org[/email]
    >
    >
    Jose Malacara Guest

Similar Threads

  1. using Net::SSH::Perl with Expect
    By dan byers in forum PERL Modules
    Replies: 0
    Last Post: November 21st, 08:41 PM
  2. Expect and rsh
    By Mary Jo in forum PERL Modules
    Replies: 1
    Last Post: December 10th, 06:22 PM
  3. tip with expect+sending '~.'
    By mgoland@optonline.net in forum PERL Beginners
    Replies: 0
    Last Post: October 30th, 08:47 PM
  4. INC is not what I expect
    By niz in forum PERL Miscellaneous
    Replies: 2
    Last Post: July 23rd, 08:57 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139