Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

share|improve this question

2 Answers 2

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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