rcp command is not working in crontab | Unix Linux Forums | HP-UX

  Go Back    


HP-UX HP-UX (Hewlett Packard UniX) is Hewlett-Packard's proprietary implementation of the Unix operating system, based on System V.

rcp command is not working in crontab

HP-UX


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 09-27-2012
BPANDEY BPANDEY is offline
Registered User
 
Join Date: Sep 2012
Last Activity: 8 May 2014, 6:49 AM EDT
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
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.


Code:
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

Last edited by Scrutinizer; 09-27-2012 at 04:34 AM.. Reason: code tags
Sponsored Links
    #2  
Old 09-27-2012
Citroen Citroen is offline
Registered User
 
Join Date: Jul 2012
Last Activity: 13 March 2013, 9:10 AM EDT
Posts: 16
Thanks: 0
Thanked 1 Time in 1 Post
Hello, What is the output of cron command? Please see /var/adm/cron/log. Regards
Sponsored Links
    #3  
Old 09-27-2012
methyl methyl is offline Forum Advisor  
Advisor
 
Join Date: Mar 2008
Last Activity: 18 April 2014, 5:13 AM EDT
Posts: 6,396
Thanks: 287
Thanked 672 Times in 642 Posts
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)?

Last edited by methyl; 09-27-2012 at 10:17 AM..
    #4  
Old 09-28-2012
BPANDEY BPANDEY is offline
Registered User
 
Join Date: Sep 2012
Last Activity: 8 May 2014, 6:49 AM EDT
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
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,
Sponsored Links
    #5  
Old 09-28-2012
Citroen Citroen is offline
Registered User
 
Join Date: Jul 2012
Last Activity: 13 March 2013, 9:10 AM EDT
Posts: 16
Thanks: 0
Thanked 1 Time in 1 Post
Try this in crontab


Code:
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


Code:
touch  /tmp/this_is_a_test
exit 0

Keep us in touch.

Regards
Sponsored Links
    #6  
Old 09-28-2012
methyl methyl is offline Forum Advisor  
Advisor
 
Join Date: Mar 2008
Last Activity: 18 April 2014, 5:13 AM EDT
Posts: 6,396
Thanks: 287
Thanked 672 Times in 642 Posts
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"?
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Crontab not working, please help samantha13 UNIX for Advanced & Expert Users 0 08-02-2012 12:25 PM
crontab is not working. getrue Solaris 6 07-27-2011 12:34 AM
crontab not working rajesh_hv UNIX for Advanced & Expert Users 4 10-28-2008 07:45 AM
crontab command not working digant UNIX for Advanced & Expert Users 8 01-04-2004 08:46 PM
crontab not working right kymberm UNIX for Dummies Questions & Answers 3 07-09-2003 04:21 PM



All times are GMT -4. The time now is 03:18 PM.