rcp command is not working in crontab

Dear Friends,

I am trying to copy SAP log file from one HPux server1 to another HPux server2 remotely through one script.
following command has written in the script.

rcp -rp /oracle/PRD/sapreorg/*.dbf oraprd@drsite:/oracle/PRD/sapreorg

Above command working fine from command mode.
But whenever I try to execute it throu crontab it is not working.

Please help.

Thanks & Regards,
Bhagawati Pandey

Hello, What is the output of cron command? Please see /var/adm/cron/log. Regards

Please post the line from crontab , the Operating System and version, the whole script, and any output seen in unix mail for the owner of the cron.

Is the owner of the crontab the same user as the interactive user. If not, has the remote system been configured to allow rcp from the owner of the crontab? (e.g. with an entry in a .rhosts file or similar)?

Hi,
Output of the /var/adm/cron/log is
>CMD: /oracle/PRD/scripts/logshipment.sh
>oraprd 2900 c Wed Sep 26 14:15:00 IST 2012
<oraprd 2900 c Wed Sep 26 14:18:00 IST 2012
Regards

---------- Post updated at 11:38 AM ---------- Previous update was at 11:31 AM ----------

Line from cron is as under
15 1,5,10,14,20,23 * * * /oracle/PRD/logshipment.sh
Operating system is hp_ux 11.31 ia64

Regards,

Try this in crontab

15 1,5,10,14,20,23 * * * /bin/sh /oracle/PRD/logshipment.sh

If it doesn't work, just after the first line (i.e. #!/bin/sh) of logshipment.sh, put these lines

touch  /tmp/this_is_a_test
exit 0

Keep us in touch.

Regards

The default Shell for HP-UX cron is already /bin/sh - which is the Posix Shell.

We can deduce that the crontab is owned by user "oraprd", and that the cron apprently ran for 3 minutes without the script failing as such.

Is there anything in /var/mail/oraprd ? This is where any output from the script will be found.

Unless it is just the one line already posted, please post the actual contents of: /oracle/PRD/logshipment.sh

When you ran from the command line, were you logged in as user "oraprd"?