I am trying to make a command which will find all the files modified in past 24 hours and which are PHP only with a loop to look into each public_html directories and save the output into a HTML file so i can view daily.
for i in `ls /var/cpanel/users`;
do find /home/$i/public_html -type f -ctime -1 -exec ls -ls {} \; >
/home/demo4/public_html/output.html;
done;
But it is not working properly and giving output not correct.. here is the output which is only for 1 account, it should be for all accounts
0 -r-xr-xr-x 1 ziaengg ziaengg 0 Jan 12 15:16 /home/ziaengg/public_html/modules/mod_rsflashmatic/xml/rsflashmatic_93.xml 23320 -rw-r--r-- 1 ziaengg ziaengg 23851008 Jan 12 15:25 /home/ziaengg/public_html/error_log
Also i would like to learn how can i email the result to any specific id..
And what parameter should i add if i want to exclude any file containing the keyword cache
.
I am really new to this.
mailx
command: http://heirloom.sourceforge.net/mailx/mailx.1.html#30 – muru Jan 12 '15 at 14:22