I have a website on a hosting provider, which allows cron jobs to be set up via cpanel. I have the below cron job set up. The problem is it is returning 'No Changes' when I know there are changes in /home/myusername/public_html within the last 24 hours.
If I log into cpanel manually to test this job It does show changes because the act of logging in changes a lot of files within my root, so I can't really test reliably.
I'm trying to exclude the security folder because it comes up access denied in the output so I want a cleaner output. (Also I think the permission denied message is preventing the 'no changes found' condition from working when it's actually true.
So my question is, is there something wrong with the way I've constructed this cron job/shell command that is preventing it from taking the expected action (find changes in my root folder structure, including
findout=$(find /home/myusername -path /home/myusername/.security -prune -o -type f -mtime -1 | egrep '.*') && (printf "Found Changes...\n\n $findout") || (printf "No Changes")
(the command is all one line but I have split it in the question for better readability)