Sunday, July 13, 2008

Cron jobs

example :
applmgr@dnux062: /home/applmgr> crontab -l
# 0 6 * * * /opt/oracle/local/bin/applptmp_cleanup ERPPROD
0,15,30,45 0-23 * * * /opt/oracle/local/bin/applptmp_cleanup ERPPROD
0 * * * * /opt/oracle/local/bin/applcsf_cleanup ERPPROD
# 0 0-23 * * * /home/applmgr/kevin/gcca_update_oe_interface2.sh
minute(s) hour(s) day(s) month(s) weekday(s) command(s)

applmgr@dnux046: /etc> crontab -l
0 6 * * * /home/applmgr/local/bin/applptmp_cleanup ERPTEST1
0 6 * * * /home/applmgr/local/bin/applcsf_cleanup ERPTEST1


applmgr@dnux046: /home/applmgr/local/bin> vi applptmp_cleanup
"applptmp_cleanup" 4 lines, 221 characters
#!/bin/sh
find /opt/grc/mvs/$1/temprpt -mtime +3 -name "*.t" -exec rm -f {} \;
find /opt/grc/mvs/$1/temprpt -mtime +3 -name "*.tmp" -exec rm -f {} \;
find /opt/grc/mvs/$1/temprpt -mtime +3 -name "*.dbg" -exec rm -f {} \;

applmgr@dnux046: /home/applmgr/local/bin> vi applcsf_cleanup
#!/bin/sh
find /opt/grc/mvs/$1/temp/out/$1_dnux046 -mtime +1 -name "M*.dat" -exec rm -f {} \;
find /opt/grc/mvs/$1/temp/out/$1_dnux046 -mtime +1 -name "M*.ctl" -exec rm -f {} \;
find /opt/grc/mvs/$1/temp/out/$1_dnux046 -mtime +11 -name "*.r[12345]" -exec rm -f {} \;
find /opt/grc/mvs/$1/temp/out/$1_dnux046 -mtime +11 -name "p*.c[12345]" -exec rm -f {} \;


Summary of the problem: The permissions of the FIFO file in /var/adm/cron was altered and the cron job started to work.

Can you check the following...
Verify that you actually have a /var/adm/cron/FIFO file.
If this file is absent, you can make the pipe by running:
mknod /var/adm/cron/FIFO p
Don't forget to include the p argument at the end.
The output destination for cron error messages is console.
cron aborted: can't change directory to the crontab directory.
Cause:
The directory could not be changed to the crontab directory.
Action:
Create a /usr/spool/cron/crontabs directory and restart cron.
cron aborted: can't read the crontab directory
Cause:
No directory information could be read from the crontab directory.
Action:
Check the permission of the /usr/spool/cron/crontabs directory and restart cron.
cron aborted: cannot create fifo queue
Cause:
A /usr/lib/cron/FIFO file could not be created.
Action:
There might be insufficient inodes in the disk containing usr/lib/cron or the directory might not exist. Check these possibilities, then restart cron.
cron aborted: cannot access fifo queue
Cause:
The FIFO file could not be accessed.
Action:
Check the permission of the /usr/lib/cron/FIFO file, enable the file to be accessed, then restart cron.
cron aborted: cannot stat cron: FIFO exists
Cause:
cron cannot be newly executed because the FIFO file already exists (cron is already active).
Action:
None.
cron aborted: cannot open fifo queue
Cause:
The FIFO file could not be opened.
Action:
Check the permission of the /usr/lib/cron/FIFO file, enable
Cause:
The log file could not be opened.
Action:
Check the permission of the /usr/lib/cron/log file, enable the file to be opened, then restart cron.
cron aborted: cannot start fifo queue
Cause:
No information could be acquired from the /usr/lib/cron/FIFO file.
Action:
The /usr/lib/cron/FIFO file or directory might not exist. Check these possibilities, then restart cron.
cron aborted: cron could not unlink FIFO
Cause:
The /usr/lib/cron/FIFO file could not be deleted.
Action:
Check whether the /usr/lib/cron/FIFO file exists. When the file exists, use the rm command to delete it.
cron aborted: SIGTERM
Cause:
cron terminated because it received the SIGTERM signal.
Action:
None.
cannot allocate n byte of space
Cause:
Memory could not be allocated.
Action:
If necessary, increase the value of the kernel system constant MAXUMEM.

No comments:

user level export and import

expdp parfile=PLCT170.par oracle@uslp123sd7dfcvxsza > more PLCT050.par userid= "/ as sysdba" dumpfile=T050.dmp logfile=expdpT0...