cancel
Showing results for 
Search instead for 
Did you mean: 

SCP is not working with at job

Aji Thomas
Regular Advisor

SCP is not working with at job

SCP is not working with at job. But Same scp command is working fine using command prompt, What is the issue with SCP automation?
9 REPLIES
Dennis Handly
Acclaimed Contributor

Re: SCP is not working with at job

How does it fail?
sangilak
Trusted Contributor

Re: SCP is not working with at job

Hi,


I am taking a wild guess here (not that much information to work with) and assume that the problem is that passwordless scp/ssh is not correctly configured on your systems...

If this is the case (you are prompted to enter a password when issuing the scp command on its own) follow the steps in the attached document to setup passwordless ssh on your systems.

If that does not help let us know some more details about what exactly is not working (e.g. which errors do you get and such).


sangilak
Aji Thomas
Regular Advisor

Re: SCP is not working with at job

We are trying to copy files from server AAA to server BBB using SCP.

For e.g we are running SCP command from server BBB as below:
--------------------------------------
scp -p AAA:/xxx/*_1_*.arch /yyy/
--------------------------------------

This is working fine, files are getting copied from server AAA to server BBB.


But when we are running same using "at" command as below:

We have created 1.sh file with SCP command.

at -f /zzzz/1.sh 8:30

It is not doing anything, No error & no files are getting copied to server BBB.

Thanks.
Doug O'Leary
Honored Contributor

Re: SCP is not working with at job

Hey;

run the at job and log the results somewhere:

at now
scp [[snip]] > /tmp/scp_log 2>&1
^D

the log will tell you why the scp command is failing. There are any number of potential reasons. You really haven't given us enough information to tell you which of those reasons is affecting you.

Doug

------
Senior UNIX Admin
O'Leary Computers Inc
linkedin: http://www.linkedin.com/dkoleary
Resume: http://www.olearycomputers.com/resume.html
Jose Mosquera
Honored Contributor

Re: SCP is not working with at job

Hi,

A trivial, Have you autorized at user that are executing the "at" command into /var/adm/cron/at.allow file?

Rgds.
Aji Thomas
Regular Advisor

Re: SCP is not working with at job

Thanks for update.

Just now We checked single SCP command is working with "at" but when we use with one more command i.e. "ssh". SCP command is not getting executed.

But 1st ssh command is executing.

ssh serverA mv /xyz/*_1_*.arch /xxx/
scp -p serverA:/xxx/*_1_*.arch /yyy/


Aji Thomas
Regular Advisor

Re: SCP is not working with at job

Any idea why it is happening?

Regards.
Dennis Handly
Acclaimed Contributor

Re: SCP is not working with at job

>Any idea why it is happening?

Not without some specific error messages.
Torsten.
Acclaimed Contributor

Re: SCP is not working with at job

A wild guess: using scp with full path will work, e.g.

/usr/local/bin/scp instead of just scp only.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!