Ubuntu server with users
root www-data mywebsite1 mywebsite2
There are multiple websites hosted on this server, each with their own user.
Each website has their own cron jobs mostly backing up files and sending emails.
Should I run all cron jobs using a universal user like www-data or root?
Or should I run the jobs as the specific user for each site as each cron job is specific to the individual site?
Generally, cron jobs that do things like “backup files” and “send email” need to do so within the context of the user whose files they are manipulating. This ensures that they have permission to read and write the files, and that actions taken can be audited as corresponding to that user.
So you will want to run the cron jobs as the user on whose behalf they act.
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.