Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cron does´nt work

Status
Not open for further replies.

yordangs

ISP
Sep 7, 2001
91
MX
hello to everyone i have the next problem i program a script who delete al de *.lock files in the /var/spool/mail/ my script its this:

rm /var/spool/mail/*.lock

the file who have this cript it calls borralocks.sh in te crontab i put the nex line to run this task every five minutes, this its the line in the contab file

5 * * * * /var/spool/mail/borralocks.sh

the problem ist the cron dont run the script the file have the 755 permissions any one have a idea why cron its not running any of the tasks.

and if i make a ps -e | grep cron its return me this , this menas the daemon its runnin

ps -e | grep cron
3754 - 0:29 cron

the complete cron file its this.

# disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
#
#0 3 * * * /usr/sbin/skulker
#45 2 * * 0 /usr/lib/spell/compress
#45 23 * * * ulimit 5000; /usr/lib/smdemon.cleanu > /dev/null
0 11 * * * /usr/bin/errclear -d S,O 30
0 12 * * * /usr/bin/errclear -d H 90
0 * * * * /usr/sbin/sendmail -q 1>/dev/null 2>/dev/null
# SSA warning : Deleting the next two lines may cause errors in redundant
# SSA warning : hardware to go undetected.
01 5 * * * /usr/lpp/diagnostics/bin/run_ssa_ela 1>/dev/null 2>/dev/null
0 * * * * /usr/lpp/diagnostics/bin/run_ssa_healthcheck 1>/dev/null 2>/dev/null
# SSA warning : Deleting the next line may allow enclosure hardware errors to go
undetected
30 * * * * /usr/lpp/diagnostics/bin/run_ssa_encl_healthcheck 1>/dev/null 2>/dev/
null
# SSA warning : Deleting the next line may allow link speed exceptions to go und
etected
0 4 * * * /usr/lpp/diagnostics/bin/run_ssa_link_speed 1>/dev/null 2>/dev/null
#30 4 * * * /home/root/respaldoDiario.sh
30 3 * * 1 /home/root/borraBorrados.sh
59 23 * * * /home/root/logmail.sh 1> /dev/null 2> /dev/null
5 * * * * /var/spool/mail/borralocks.sh
 
Do this...

do a "crontab -e"

from with the editor that comes up, do a ":wq!"

Bill.
 
thanks for the tip bjverzal but im edit the crontab by that way by that reason my task its in the cron or how a have to put the line to run every 5 minutes i thing my line its rigth or is´nt it?

5 * * * * /var/spool/mail/borralocks.sh

any other idea ???
 
under AIX, sh is a link to ksh.

How do you know for sure the cron job is not running ?

Bill.
 
well now i know my script its running but its runing every hour example the 3 times the scripts runs was.
11:05
12:05
and 1:05

but i need to run every 5 minutes what could be happen??
its this sintax correct???

5 * * * * /var/spool/mail/borralocks.sh

and in my script i only put this line

rm /var/spool/mail/*.lock

and dont especify the shell they need yo use, but im look into the other scripts and dont have in the first line #!/usr/bin/ksh

but the extrange its the scripts runs but every hour and i need run every five minutes

thanks alot for the help
 
Oh DUH! It just hit me. I guess I needed a lunch break to help me see it...

It is doing exactly what it should be doing, according to how it is writte, You need to change it as follows:

0,5,10,15,20,25,30,35,40,45,50,55 * * * * /var/spool/mail/borralocks.sh

Bill.
 
ok i think it was a mistake for my part but thans alot know im understand who it works the cron thaks alot bill
 
sorry i write to fast jeje thanks a lot for the help bill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top