hi,
i’m just discovering the terminal and could do with i bit of advice on setting up cron.
i have this problem;
i am currently using icall to run a workflow once a week
however, if my notebook is offline when the workflow is scheduled to run, it won’t be executed.
after doing a bit of research, i notest that cron can carry out such tasks and even more anacron will check if any jobs have been mist.
i also downloaded launchd Editer
Q. does anacron check for launchd jobs?
i notest if i cat the /etc/crontab file i get this;
The periodic and atrun jobs have moved to launchd jobs
See /System/Library/LaunchDaemons
minute hour mday month wday who command
i notest in System/Library/LaunchDaemons are the weekly, daily, monthly plist’s.
can i edit these and add a job to run my shell script, if so will anacron check these plists, if so, please tell me how?!
if any one knows what the hell im going on about and can point me in the right direction, i’d be very greatfull.
seriously you should just use cron to run the jobs. (i don’t know what anacron is)
if you don’t need root priveleges then i sugest using your users crontab which can be opened with the command
" crontab -e"
then the file will be blank but put this line in for your own benifit.
wday is 1= mon , 2 =tue , … , 0 & 7 = Sun
so if i want to run the scritp at 3:43 am everyday i would put in the line (usercrontab)
3 43 * * * sh ~/script.sh
but if need root priv. the /etc crontab you will have to use the user column as well so like this
"sudo vi /etc/crontab
3 43 * * * root /User/username/script.sh
I have used anacron and to answer your question, yes, those maintenance tasks are now done by launchd, but cron is still available. When you install anacron, it will create a sample anacrontab file. More will be revealed when you read the anacron and anacrontab man pages.
Andy.
p.s. I eventually removed anacron as it was constantly sending error emails to me due to a malformed crontab file. I was only using it to run the maintenance scripts anyway…
Model: G5 Dual 2.7 GHz
AppleScript: 2.0 (v43.1)
Browser: Safari 312
Operating System: Mac OS X (10.4)