Cron daemon

Jing

Verified User
Joined
Jul 30, 2003
Messages
85
may i know under which file does DA store all the cron info for users?
 
Hello,

/usr/local/directadmin/data/users/username/crontab.conf

is the file that stores the cron information. Modification of this file alone will not add the new cron settings to the cron daemon. It simply stores the data for the user's panel. To actually write the crontab so that the daemon uses it, the crontab.conf file has to be re-written into a temp file (in proper crontab format), and then the following command would be run:
Code:
/usr/bin/crontab -u username tempfile
Hope this helps,

John
 
if a user uses cron daemon to run a background process, will the process be ran under root? or is it under that user's id?
 
It would be run under the user's id. Giving everyone root access on the server would be far too much fun :D

John
 
Sorry if this is an obvious question, but I have used sed to edit a large amount of user's crontab.conf:

find ./ -name crontab.conf -exec sed -i 's:/dev/null$:/dev/null >/dev/null 2>\&1:g' {} \; -print

And I was wondering if the command directadmin invokes to parse these into proper cron format, and install them, was available?

Thanks.
Alex
 
You can probably just press the "Delete" button from within DA to get DA to rewrite the crontab from the cron.conf. Don't select any crons. If you need it done in mass, then "Delete" via the API (same thing using as script).

There isn't a task.queue rewrite command.

John
 
Thanks for the response - the problem being that we're programmatically adding these cron tasks. Perhaps I could use the DA API to get the job done somehow?
 
Back
Top