can I use @reboot in cron.d files?

Posted by fschwiet on Server Fault See other posts from Server Fault or by fschwiet
Published on 2014-06-12T17:57:48Z Indexed on 2014/06/12 21:27 UTC
Read the original article Hit count: 143

Filed under:

I want to run a job with cron on reboot as a particular user. I have been able to do this successfully using crontab to write to /var/spool/cron/crontabs/username with something like:

 @reboot ./run.sh >>~/tracefile 2>&1

However, I want to use /etc/cron.d/filename. Cron jobs in this file require an extra column to indicate what user runs, so I use:

 @reboot wwwuser ./run.sh >>~/tracefile 2>&1

This doesn't seem to work. Should I be able to use @reboot with a username in a cron.d file?

© Server Fault or respective owner

Related posts about cron