John Andersen wrote:
On Tuesday 10 April 2007, G.T.Smith wrote:
There is no reason to make it executable. Any text file will do. It can be located anywhere.
Surely some mistake here, the root cron file in the example would have to executed to so needs execute rights :-) ... To be honest reply is a bit ambiguous..., but the original suggestion is wildly off the mark ...
No the root cron file is not executable. Nor it is executed. It is merely read by cron and the tasks listed therein are performed per schedule.
man cron man crontab
The manpage for cron is strictly speaking inaccurate for the SuSE distribution. There are two sub directories under /var/spool/cron. /var/spool/cron/lastrun and /var/spool/cron/tabs. It is in the latter that the table files are kept (not /var/spool/cron directly as the manpage implies). The former is used by run-crons to store the time directory locks. BTW a useful way of tweaking when these are run is to touch the relevant lock file. Off course, one should not edit the contents of /var/log/cron/tabs directly :-) crontab should always be used. Actually, for the original question it would possibly be best to add the task to the /etc/crontab file (it is the system crontable). By default it (in SuSE anyway) just runs the run-crons script, but there is no reason one cannot add anything else to it. Personally, I would prefer to use the user crontab for root for operations relevant to the root account as an account rather than the system as whole. To get to manpage describing the format of the crontab file you need to enter... man 5 crontab