Sunday, January 29, 2017

What user do scripts in the cron folders run as? (i.e. cron.daily, cron.hourly, etc)




If I put a script in /etc/cron.daily on CentOS what user will it run as? Do they all run as root or as the owner?


Answer



They all run as root. If you need otherwise, use su in the script or add a crontab entry to the user's crontab (man crontab) or the system-wide crontab (whose location I couldn't tell you on CentOS).


No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...