|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
||||
|
||||
|
Can't find the source of what appears to be a cron job
Hi guys.
I've taken over a linux box from a previous programmer and there is a shell script that runs every day. The problem is, I don't know how this is happening. I've printed out the crontab files for every user in /etc/passwd and nobody has a cron job that executes the script (I do know where the script is, however). I know it's executing every day because I see the resulting tarred and gzipped file. I know I'm not giving you much to go on, simply because I don't know what else would be useful, but am I missing something obvious here? Is there another type of scheduling utility that I don't know about? Any clues that could help me would be greatly appreciated. Thanks in advance. |
|
#2
|
||||
|
||||
|
Have you checked the directory /etc/cron.daily (also hourly, weekly, monthly) for the contents?
There's also the AT scheduler, but I'm not too familiar with that one. //NoXcuz
__________________
UN*X is sexy! who | grep -i blonde | date; cd ~; unzip; touch; strip; finger; mount; gasp; yes; uptime; umount; sleep |
|
#3
|
||||
|
||||
|
I see a number of scripts in the /etc/cron.daily directory, but nothing that would indicate some type of daily scheduling program. I was thinking about modifying the script to print out the contents of the environment variable that indicates what called a program. I've got to do a little research to see just what that variable is. Other than that, I'm not sure what to do.
|
|
#4
|
||||
|
||||
|
you can also add cron jobs directly to /etc/crontab - this is what takes care of running all the scripts/symlinks in the /etc/cron.time_interval directories, BTW.
Check there, as well. |
|
#5
|
||||
|
||||
|
#cat /var/spool/cron/crontabs/*
shows all the crons running on /my/ system christo
__________________
. Spiration channels: Free scripts, programming tutorials and articles Dotcut alerts: Online Press cuttings / news alerts Clearprop: UK microlight school, wiltshire Uk dating: UK safe dating with Topdates About Christo . . |
|
#6
|
||||
|
||||
|
Well in this case since the script seems to be running daily, I checked the /etc/cron.daily directory. Again, there doesn't seem to be anything in there that's kicking off the shell script. The good thing is, I at least know which script is executing. Obviously, worst case scenario, I simply remove the script. But I just find it maddening that I have some process running at about 6:30pm or so every day (based on the timestamp of the file created) and don't know what's doing it. Again, I printed out everybody's cron contents and nothing shows up. As a matter of fact, there are cron entries for only two uses: root and mailmain and I created the entry for root. I'll probably just remove the script for now and play detective later. Thanks guys.
|
|
#7
|
|||
|
|||
|
running crontab -l as superuser should return something similar to this:
Code:
47 * * * * /usr/bin/run-parts /etc/cron.hourly 1> /dev/null 40 10 * * * /usr/bin/run-parts /etc/cron.daily 1> /dev/null 30 10 * * 0 /usr/bin/run-parts /etc/cron.weekly 1> /dev/null 20 10 1 * * /usr/bin/run-parts /etc/cron.monthly 1> /dev/null these are the cron jobs that execute ALL of the scripts in /etc/cron.* at the respective interval. if you don't want that script to execute on a daily basis, then remove it from /etc/cron.daily. if you want it to be executed at a different interval, then move it to another /etc/cron.* folder or put it somewhere else on your filesystem and create a crontab for it. |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > Linux Help > Can't find the source of what appears to be a cron job |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|