Linux Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsLinux Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old February 12th, 2003, 07:10 AM
colpaarm's Avatar
colpaarm colpaarm is offline
300lb Bench!
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Aug 2001
Location: New York
Posts: 2,191 colpaarm User rank is Corporal (100 - 500 Reputation Level)colpaarm User rank is Corporal (100 - 500 Reputation Level)colpaarm User rank is Corporal (100 - 500 Reputation Level)colpaarm User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 5 h 8 m 19 sec
Reputation Power: 11
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.

Reply With Quote
  #2  
Old February 12th, 2003, 07:29 AM
NoXcuz's Avatar
NoXcuz NoXcuz is offline
Wiking
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Sep 2000
Location: Sweden
Posts: 3,608 NoXcuz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 49 m 27 sec
Reputation Power: 11
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

Reply With Quote
  #3  
Old February 12th, 2003, 09:24 AM
colpaarm's Avatar
colpaarm colpaarm is offline
300lb Bench!
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Aug 2001
Location: New York
Posts: 2,191 colpaarm User rank is Corporal (100 - 500 Reputation Level)colpaarm User rank is Corporal (100 - 500 Reputation Level)colpaarm User rank is Corporal (100 - 500 Reputation Level)colpaarm User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 5 h 8 m 19 sec
Reputation Power: 11
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.

Reply With Quote
  #4  
Old February 12th, 2003, 11:52 AM
Hero Zzyzzx's Avatar
Hero Zzyzzx Hero Zzyzzx is offline
11
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Jul 2001
Location: Lynn, MA
Posts: 4,632 Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level)Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level)Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level)Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level)Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level)Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level)Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 4 Days 23 h 12 m 33 sec
Reputation Power: 77
Send a message via AIM to Hero Zzyzzx
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.

Reply With Quote
  #5  
Old February 12th, 2003, 01:47 PM
christo's Avatar
christo christo is offline
Introspective
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Nov 2001
Location: London, UK
Posts: 3,296 christo User rank is Second Lieutenant (5000 - 10000 Reputation Level)christo User rank is Second Lieutenant (5000 - 10000 Reputation Level)christo User rank is Second Lieutenant (5000 - 10000 Reputation Level)christo User rank is Second Lieutenant (5000 - 10000 Reputation Level)christo User rank is Second Lieutenant (5000 - 10000 Reputation Level)christo User rank is Second Lieutenant (5000 - 10000 Reputation Level)christo User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 3 Days 1 h 5 m 42 sec
Reputation Power: 101
Send a message via ICQ to christo Send a message via Yahoo to christo
#cat /var/spool/cron/crontabs/*

shows all the crons running on /my/ system

christo

Reply With Quote
  #6  
Old February 13th, 2003, 07:40 AM
colpaarm's Avatar
colpaarm colpaarm is offline
300lb Bench!
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Aug 2001
Location: New York
Posts: 2,191 colpaarm User rank is Corporal (100 - 500 Reputation Level)colpaarm User rank is Corporal (100 - 500 Reputation Level)colpaarm User rank is Corporal (100 - 500 Reputation Level)colpaarm User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 5 h 8 m 19 sec
Reputation Power: 11
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.

Reply With Quote
  #7  
Old February 13th, 2003, 08:32 AM
jwalk76 jwalk76 is offline
Huge Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2002
Posts: 141 jwalk76 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 m 3 sec
Reputation Power: 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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsLinux Help > Can't find the source of what appears to be a cron job


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway