2

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

2 Answers 2

6

The user you added the cron job as.

1
  • 2
    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. Dec 11, 2010 at 14:50
3

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.

2
  • I'm using Mac OS X and I did edit with crontab -e. How do you think in my case?
    – Eonil
    Dec 12, 2010 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, 2010 at 23:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .