If I set cron job for a normal user instead of root, what account execute the scheduled jobs?

link|improve this question

68% accept rate
feedback

2 Answers

up vote 5 down vote accepted

The user you added the cron job as.

link|improve this answer
1  
Though... were do you set the cron job? If it's in /etc/crontab or /etc/cron.d, you have to specify the user it runs as explicitly. But then you'd know, so Ignacio's answer is probably fully on the mark. – Jürgen A. Erhard Dec 11 '10 at 14:50
feedback

Cron jobs in /etc/crontab and /etc/cron.d/ run as the user specified in the extra username field. Cron jobs in files in /var/spool/crontab/ (or your distro's equivalent) run as the user who inserted that crontab, usually the user for whom the file is named.

link|improve this answer
I'm using Mac OS X and I did edit with crontab -e. How do you think in my case? – Eonil Dec 12 '10 at 14:02
the crontab application modifies the user's crontab file in /var/spool/crontab (not sure about the OSX equivalent), and thus runs as the user. – Sparr Dec 12 '10 at 23:38
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.