Q:

run cron job as specific user

# Crontab Running as a Specific User
# From root's crontab sudo crontab -e, you can use:
1 1 * * * su username -c "/path/to/your/script.sh"
0
# Crontab Running as a Specifi User
# Through Command Line, you use the User's Actual crontab like this:
sudo crontab -u username -e
0
# Crontab Running as a Specific User
# Only /etc/crontab and the files in /etc/cron.d/ have a username field. In that file you can do this:
1 1 * * * username /path/to/your/script.sh
0

New to Communities?

Join the community