image
image

|


Go Back   macosx.com > Mac Help Forums > Unix & X11

Reply
 
Thread Tools
  #1  
Old October 22nd, 2002, 09:49 PM
emh_alpha1's Avatar
Registered User
 
Join Date: Jun 2001
Location: New Zealand
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
emh_alpha1 is on a distinguished road
Question Cron Help Please

First time using CRON - downloaded Cronnix and setup cron task to run. Nothing happened when the set time rolled around. Found some documentation - suggested checking process to see if Cron was running. Does not appear to be. How do I enable cron? I'm running 10.2.1. Is this yet another thing that 10.2 disables?

Thanks in advance.

EMH.
__________________
Macintosh G5 Dual 2.4Ghz 500Mb 120Gb/1Gb/160Gb - OSX 10.3.2


"Please state the nature of the
medical emergency..."
Reply With Quote
  #2  
Old October 22nd, 2002, 10:48 PM
Registered User
 
Join Date: Oct 2002
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
jwalk76 is on a distinguished road
ps -ax | grep cron

will tell you if the daemon is running. unfortunately, i'm only running 10.1.5, so i'm not sure if your installation is different. i can say that i don't think they would remove cron from the default install as it's highly useful.

###### to test if cron works make a simple script called test.sh:

#!/bin/sh
ps -ax > /Users/your_user_name/testresults

###### set the right permissions on the script:

chmod 700 /Users/your_user_name/test.sh

###### open your crontab with:

crontab -e

###### once your editor launches type this:

* * * * * /Users/your_user_name/test.sh

once the system clock ticks forward a minute check your home directory for the testresults file that should contain the output of the command ps -ax. don't forget to disable the cron job when your done testing.
Reply With Quote
  #3  
Old October 22nd, 2002, 11:38 PM
emh_alpha1's Avatar
Registered User
 
Join Date: Jun 2001
Location: New Zealand
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
emh_alpha1 is on a distinguished road
still not going

thanks for your quick response.

i tried everything you suggested, but still no results.
[USS-Voyager-NCC-74656:~] mthomson% ps -ax |grep cron
321 ?? Ss 0:00.03 cron
507 std UV+ 0:00.12 grep cron

so it looks like grep is running.

set up the script as you instructed and set the crontab but still doesn't generate the testresults doc no matter how long you wait. if i run test.sh manually it works fine and generates the output. so cron is still letting the side down?

any other ideas?

EMH
__________________
Macintosh G5 Dual 2.4Ghz 500Mb 120Gb/1Gb/160Gb - OSX 10.3.2


"Please state the nature of the
medical emergency..."
Reply With Quote
  #4  
Old October 23rd, 2002, 12:05 AM
emh_alpha1's Avatar
Registered User
 
Join Date: Jun 2001
Location: New Zealand
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
emh_alpha1 is on a distinguished road
Talking cron doh!

okay got it - it's working now. it won't acknowledge the changes in the crontab until you log out and back in again. is there anyway to force it to update/reload besides logging in and out?

Thanks

EMH
__________________
Macintosh G5 Dual 2.4Ghz 500Mb 120Gb/1Gb/160Gb - OSX 10.3.2


"Please state the nature of the
medical emergency..."
Reply With Quote
  #5  
Old October 23rd, 2002, 07:24 AM
Registered User
 
Join Date: Oct 2002
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
jwalk76 is on a distinguished road
i don't know. i've never had that problem. my cron jobs have always been updated instantly. good luck.
Reply With Quote
  #6  
Old October 25th, 2002, 08:16 PM
michaelsanford's Avatar
Psycholinguist
 
Join Date: Oct 2002
Location: Ottawa/Montrιal
Posts: 2,143
Thanks: 0
Thanked 0 Times in 0 Posts
michaelsanford is on a distinguished road
Lightbulb Restart cron

You can make the crontab reload by killing it and restarting it with the following. First, you find out where cron is (/usr/sbin/cron), then get the PID of cron, then kill it, then restart it. That should reload the changed crontab. Note that you'll need sudo for everything except `ps`.

Code:
Welcome to Helios;
*AUTHORIZED PERSONNEL ONLY*

Fri Oct 25 21:09:02 EDT 2002
 9:09PM  up 1 day,  6:47, 2 users, load averages: 1.32, 0.77, 0.67
No new messages.
No mail for gwailo
[gwailo:~]% which cron
/usr/sbin/cron

[gwailo:~]% ps -ax | grep cron
  312  ??  Ss     0:00.37 cron
  568 std  R+     0:00.01 grep cron

[gwailo:~]% sudo kill 312
Password:

[gwailo:~]% sudo /usr/sbin/cron
[gwailo:~]%

[gwailo:~]% ps -ax | grp cron

OK? ps -ax | grep cron? yes
  573  ??  Ss     0:00.02 /usr/sbin/cron
  575 std  R+     0:00.00 grep cron
Just remember that there's a lot of system stuff set up as cronjobs, so if you can't get it to work, I'd restart your comuter just to make sure it's running.

HTH
__________________
michaelsanford.com • Blog • Twitter • Tumblr • LinkedIn
• iBook G4 1.42 GHz | MacOS X 10.5-current | 1 GB RAM, 100 GB HDD
• iMac G4 TFT 700 MHz | MacOS X 10.3.9 | 768 MB RAM, 40 GB HDD
• AMD Athlon64 3500+ | Slackware 12 (2.6.21.5-smp) | 2 GB RAM, 2•120 GB RAID 1, 2•500 GB RAID 0
Reply With Quote
  #7  
Old October 26th, 2002, 06:43 AM
usin UNIX since '92
 
Join Date: Oct 2000
Location: Barcelona, Catalonia - Spain
Posts: 249
Thanks: 0
Thanked 0 Times in 0 Posts
dani++ is on a distinguished road
Same here. I have never heard of the cron process to be restarted to accept new changes. Something is wrong in the procedure you are using.


dani
Reply With Quote
  #8  
Old October 26th, 2002, 12:14 PM
michaelsanford's Avatar
Psycholinguist
 
Join Date: Oct 2002
Location: Ottawa/Montrιal
Posts: 2,143
Thanks: 0
Thanked 0 Times in 0 Posts
michaelsanford is on a distinguished road
Yeah I should hvae mentioned that too, I've never had to restart it...
__________________
michaelsanford.com • Blog • Twitter • Tumblr • LinkedIn
• iBook G4 1.42 GHz | MacOS X 10.5-current | 1 GB RAM, 100 GB HDD
• iMac G4 TFT 700 MHz | MacOS X 10.3.9 | 768 MB RAM, 40 GB HDD
• AMD Athlon64 3500+ | Slackware 12 (2.6.21.5-smp) | 2 GB RAM, 2•120 GB RAID 1, 2•500 GB RAID 0
Reply With Quote
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems with CRON running PHP scripts AGBlee1970 Unix & X11 3 July 11th, 2003 04:08 AM
cron process not starting up sinebubble Mac OS X System & Mac Software 2 March 11th, 2002 12:10 AM
How do you get cron to work? buc99 Mac OS X System & Mac Software 1 January 2nd, 2002 03:32 PM
ftp and cron scheduling AxsDeny Mac OS X System & Mac Software 2 November 18th, 2001 08:38 AM
mysqldump and cron aussieron Mac OS X System & Mac Software 2 November 6th, 2001 04:45 PM


All times are GMT -5. The time now is 04:55 PM.


Mac Support® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2000-2008 DigitalCrowd, Inc.