LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   cronjab (https://www.linuxquestions.org/questions/linux-newbie-8/cronjab-4175422708/)

shubhamuddu 08-17-2012 11:46 PM

cronjab
 
Hello...

I scheduled backup scripts using cronjob as below but nothing is happening, no errrors even. Please suggest what changes required..?


0 1 * * 0 /bin/sh /home/orasup/scripts/rman_weekly_full_bkp.sh (full backup every Sunday at 01:00 am)
30 2 * * 2,4,6 /bin/sh /home/orasup/scripts/rman_daily_incr_bkp.sh (Incremental level 1 backup every Tuesday, Thursday, Saturday at 01:00 am)
0 3 * * 3,5 /bin/sh /home/orasup/scripts/rman_daily_cumulative_bkp.sh(Cumulative backup every Wednesday, Friday at 01:00 am)

Thanks in advance...

jsaravana87 08-17-2012 11:54 PM

Hi
check out whether crond service is enabled and running !

[root@node01 ~]# service crond status
crond (pid 18896) is running...
[root@node01 ~]#

speck 08-18-2012 02:05 AM

Code:

0 1 * * 0 /bin/sh /home/orasup/scripts/rman_weekly_full_bkp.sh (full backup every Sunday at 01:00 am)
30 2 * * 2,4,6 /bin/sh /home/orasup/scripts/rman_daily_incr_bkp.sh (Incremental level 1 backup every Tuesday, Thursday, Saturday at 01:00 am)
0 3 * * 3,5 /bin/sh /home/orasup/scripts/rman_daily_cumulative_bkp.sh(Cumulative backup every Wednesday, Friday at 01:00 am)

1) Make sure you list the full paths to every script/executable within your backup shell scripts.
2) Remove the comments like (full backup every Sunday at 01:00 am) after the script, unless they are arguments, which I don't think is the case.

shubhamuddu 08-18-2012 06:11 AM

Please look at the below output, i sceduled cronjob by the user other than root user.
Should it by root user only..? If not what settings can be done at other user promp..?

[root@prod ~]# service crond status
crond (pid 5046) is running....
[root@prod ~]# su - orasup
[orasup@prod ~]$ service crond status
-bash: service: command not found

[root@prod ~]# crontab -l
no crontab for root

[orasup@prod ~]$ crontab -l
# full backup every Sunday at 01:00 am
0 1 * * 0 /bin/sh /home/orasup/scripts/rman_weekly_full_bkp.sh
# Incremental level 1 backup every Tuesday, Thursday, Saturday at 01:00 am
30 2 * * 2,4,6 /bin/sh /home/orasup/scripts/rman_daily_incr_bkp.sh
# Cumulative backup every Wednesday, Friday at 01:00 am
0 3 * * 3,5 /bin/sh /home/orasup/scripts/rman_daily_cumulative_bkp.sh


Thanks...

suicidaleggroll 08-18-2012 08:27 AM

How do you know they're not running? During this kind of debugging phase you should probably be redirecting the output if each script into a log file so you can see what's happening.
Code:

0 1 * * 0 /bin/sh /home/orasup/scripts/rman_weekly_full_bkp.sh > /home/orasup/scripts/rman_weekly_full_bkp.out 2>&1


All times are GMT -5. The time now is 10:11 PM.