do crontab run as user code example
Example 1: run cron job as specific user
# 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
Example 2: run cron job as specific user
# Crontab Running as a Specifi User
# Through Command Line, you use the User's Actual crontab like this:
sudo crontab -u username -e