Forum Moderators: coopster & phranque

Message Too Old, No Replies

Net::SCP::Expect

         

mangep

10:15 pm on May 13, 2004 (gmt 0)



Hi,
I´m trying to write a perl script to copy some customers with.

I´m trying with the following rows:

my $scpe = Net::SCP::Expect->new(user=>'$username',password=>'$password'. preserve=>1, recursive=>1, verbose=>1);

$scpe->scp('$hostname:/home/f/foobar/www/index.htm','foobar/index.htm');

This is giving me following error:
at /usr/lib/perl5/site_perl/5.8.1/Expect.pm line 733ease try again.

It look odd and I don´t know what is wrong...

Thanks for any help!

Regards,
Magnus

SeanW

2:10 am on May 14, 2004 (gmt 0)

10+ Year Member



If I had to guess, your password is wrong, and the Net::SCP::Expect module is having a hard time dealing with it.

Sean

Magnusp

6:38 am on May 14, 2004 (gmt 0)

10+ Year Member



Hi,
Thanks for for your answer.

The password i use is correct. I tried to add some prints after each scpe command to see where it goes wrong.

It seems to be wrong with:
$scpe->scp('$hostname:/home/f/foobar/www/index.htm','foobar/index.htm')

Any more tips?

Thanks

/Magnus

Magnusp

7:06 am on May 14, 2004 (gmt 0)

10+ Year Member



I found a typo in my script, after $password I have a dot (.) instead of comma (,).

Now the script is executing but...

It will not use the correct username...
If I run the script as user root on my local server it tries to login with root. If i run the script as user foobar it will use the user foobar to login.

If I run the script as the same user that I want to copy the username is correct but it still ask me to enter password...

I´ve tried with scp -r -p foobar@foobar.org:/home/foobar/ .
and entered the password. Everything works...

Please help..

/Magnus