Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question
up vote 5 down vote accepted

The user you added the cron job as.

share|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

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.

share|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

You must log in to answer this question.

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