Linux – How to run cron job as root?

On Linux, uses sudo crontab -e to define cron jobs that need to run as a root user.


$ sudo crontab -e

# Run every hour
0 * * * * * /path/this-script-need-root.sh

References

mkyong

Founder of Mkyong.com, passionate Java and open-source technologies. If you enjoy my tutorials, consider making a donation to these charities.

0 Comments
Most Voted
Newest Oldest
Inline Feedbacks
View all comments