Operating System - Linux
1825721 Members
3129 Online
109687 Solutions
New Discussion

Help with an scp command line appreciated

 
SOLVED
Go to solution
Steven E. Protter
Exalted Contributor

Help with an scp command line appreciated

/bin/sh

cd /home/xfer
scp 192.168.0.40://backups/*.gz .

Pretty simple right. I have to type exit at the command line to get the transfer to start.

This is Red Hat Linux 7.3 on both ends and the same command line works without issue in HP-UX.

Generous points awarded for the command line that makes this work without user interventions.

The prompt I get requiring an exit command looks like this:

[root@telaviv bin]# ./copyprod
sh-2.05a#

How strange is this?

Steve
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
5 REPLIES 5
Stuart Browne
Honored Contributor
Solution

Re: Help with an scp command line appreciated

How about we start with the #! line at the start of 'copyprod' ? (the first half-dozen or so lines would be nice so we can rule out a shell running there)

You're launching a sub-shell, and the script doesn't appear to be run correctly.

Apart from that, the 'scp' command shouldn't have two /'s after the :. Could cause some minor issues.

One long-haired git at your service...
Steven E. Protter
Exalted Contributor

Re: Help with an scp command line appreciated

I don't have access to the script right now, but I that was a copy/paste error writing the post.

I will check it and get back to you.

Steve
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Steven E. Protter
Exalted Contributor

Re: Help with an scp command line appreciated

It was not a copy/paste error, it was the problem.

Lesson for the youngins in sysadmin. Sometimes it takes another pair of eyes to spot the problem.

Thanks.

Steve
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Jochen Heuer
Respected Contributor

Re: Help with an scp command line appreciated

Hi Steve,

but the error you described *can* be caused by this ... So maybe it wasn't a c&p error :-)
Well, yeah ... I suppose there's no point in getting greedy, is there?
Steven E. Protter
Exalted Contributor

Re: Help with an scp command line appreciated

A grain of truth fore sure.

If I was using a gui or netterm to create the script its possible I didn't select the pound sign when cutting and pasting.

netterm can'd keep its colors straight when connected to a RH box so I rarely use it.

To maintain correct permissions, I generally copy a working script and then make changes. This means I got careless with the x key in vi.

DOH!

Steve
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com