Setting up a Cron User
Posted on 2014-08-04
I am attempting to run this command line once/day via a cron to attempt to find all of the recently changed php scripts (as a way to test to make sure a rogue PHP script hasn't been loaded).
find /var/www/vhosts/crucore.org/essentials24.net/ -name '*.php' -mtime 0
The script runs from from root, but in my plesk environment it is set up so that root cron jobs DO NOT send out a summary email so as a result I don't get the results sent to me.
I can think of two ways to do this:
1). Add something to the above line so that it sends the output to an email address.
2). Set up a second user in the system that has the right type of privileges to execute this script. I would then change this user to be send summaries.
I need some help with both of these options.
For #1, can you tell me how I add an email to have the report sent?
For #2, can you tell me how to set up this type of user via Linux Shell script (i.e. direct command lind access).