-   Linux - General (
-   -   How can I tell if crontab jobs are axecuting ? (

juanb 12-18-2003 04:14 AM

How can I tell if crontab jobs are axecuting ?
Hi !!

I edited /etc/crontab and than

did :

/etc/init.d/crond restart

I schadule a job to execute 20 minutes can I check if the system tried to execute?

whan the job starts from the command line (without crontab) another terminal window is open and than the program starts , after I edited crontab I waited and nothing happend.


Blinker_Fluid 12-18-2003 10:39 AM

Cron will never put anything on the display unless you use something like 'wall' in your cron script.
Are you redirecting output to a log file or anything? it wouldn't be hard to add a line at the bottom of your script that does something like:
date +"%D %r `echo Cron completed`" >> /tmp/cron_job.log
Then you could check /tmp/cron_job.log and it would tell you when it finished.

juanb 12-22-2003 05:10 AM

ok ! I did what u told me:
here is my contab flle: ( I added /etc/panda/run):

# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly
00 22 * * * /usr/lib/panda/ftp
30 11 * * * /etc/panda/run
0-59/5 * * * * root /usr/bin/mrtg /etc/mrtg/mrtg.cfg
date +"%D %r 'echo Cron completed'" >> /tmp/cron_job.log

this is the content of /etc/panda/run:

#script to run antivirus
cd /etc/panda/pavcl
pavcl / -AUT

[root@mr incoming]# ls -la /etc/panda/run
-rwxr-xr-x 1 root root 59 Dec 18 10:16 /etc/panda/run

I also restartes crond after the changes but he doesnt creats any file in /tmp so I dont know if /etc/panda/run executed/


TheOneKEA 12-22-2003 06:57 AM

Usually you can tell when a cron job is active, during periods of inactivity - any performance meters that are running will show the spike in %CPU, HD and general process activity. I think you can configured anacron or vixie-cron to send root an intra-system message when a job completes.

chrber 01-27-2011 10:08 AM

file /var/log/cron
This is a file where the cron job execution gets reported. I looked there and found that my job is executed.

All times are GMT -5. The time now is 01:50 AM.