Search code examples
cronshared-hostingcron-task

Cronjob to check files modified on shared hosting


I need to check if my files are modified, if yes then copy from backup folder (restore the old file).


Solution

  • OK, got part of what I was looking:

    find /home/**/public_html -mtime -1 \! -type d -ls -print0 | mailx -s "Summary of the modified files in $(date +\%d-\%m-\%Y-\%H.\%M.\%S) past hours" myemail@gmail.com
    

    But it is giving output with noname file as attachment, how can make it with a timestamp file name?