[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Sheflug] Stupid cron question





> Just out of interest, how does the system figure where to store a
> user's crontab?
> 

Hard coded in cron I'd imagine -- do a "strings crontab" and a "strings cron" 
see if the path leaps out at you. Failing that, strace the bugger :)


> Why bother with the wierdly named /tmp/ file?
> 

When you type "crontab -e", crontab starts $EDITOR. This editor is editing 
that temproray file. When you save and close $EDITOR, it installs the 
temporary file /tmp/foo.bar to /var/spool/cron/crontabs (or wherever). The 
temporary filename is random, and in your case I'd imagine the template for 
the name is /tmp/crontab.<pid>. On my box, the temporary file is 
/tmp/crontab.XXXXQQe4uS.

Try doing "crontab -l > myfile" then "crontab myfile" (this replaces the 
current crontab, which, cunningly enough is an unchanged cron. Assuming 
crontab -l worked anyway :) ), then look at the installed crontab. You'll see 
/tmp/foo.bar replaced with myfile.

Chris...



---------------------------------------------------------------------
Sheffield Linux User's Group - http://www.sheflug.co.uk
To unsubscribe from this list send mail to
- <sheflug-request [at] vuw.ac.nz> - with the word 
 "unsubscribe" in the body of the message. 

  GNU the choice of a complete generation.