 |
 |
cron an nohup weirdness under 10.2.7
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Oct 2000
Location: Pasadena, CA, USA
Status:
Offline
|
|
Yes, I have a shiny new G5 running 10.2.7, and I have two problems:
1. cron doesn't seem to run any of my added tasks
2. things run in the background using nohup are still being killed when the current user logs out
For cron, I tried using "crontab -e" for a regular user, an administrator, and root, and editing /etc/crontab directly, but in all cases the script was not run. Here's the entry I used:
*/5 * * * * * /Users/userhome/dir/script.pl
Or something like that. I'm not at my computer so I may not have the right number of "*", but the "*/5" is right - I have a job I want run every 5 minutes, period. But no love - the script doesn't run.
So I changed my script to run in a loop, sleeping for 5 minutes between loops, and tried nohup:
> nohup script.pl &
And this works, but if I log out the process is killed about 1/2 the time.
Any ideas?
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Dec 2001
Location: Atlanta, GA, USA
Status:
Offline
|
|
Originally posted by eyadams:
Yes, I have a shiny new G5 running 10.2.7, and I have two problems:
1. cron doesn't seem to run any of my added tasks
2. things run in the background using nohup are still being killed when the current user logs out
For cron, I tried using "crontab -e" for a regular user, an administrator, and root, and editing /etc/crontab directly, but in all cases the script was not run. Here's the entry I used:
Is cron actually running? There should be a process running as root like this:
Code:
[arkham@flybook /] ps -auxww | grep cron | grep -v grep
root 399 0.0 0.0 13868 140 ?? Ss Mon09AM 0:00.63 cron
If that process is not running, you need to fix that first. I remember having to do something to start cron. Anyway, cron is started by /System/Library/StartupItems/Cron/Cron if you need to investigate.
> nohup script.pl &
And this works, but if I log out the process is killed about 1/2 the time.
Not sure why your script is dying when you log out, but it might help to log the standard out/standard error. Instead, run it like this (assuming a bourne shell here):
nohup script.pl > ~/script.log 2>&1 &
If you're using csh or tcsh, do this instead:
nohup sh -c "test.pl > testlog 2>&1 &"
|
|
Mac Pro 2x 2.66 GHz Dual core, Apple TV 160GB, two Windows XP PCs
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|