Skip to main content

Cron job to test file time and send email?

Comments

4 comments

  • cPanelMichael
    Hello @ATom1, You can read about how to setup cron jobs in cPanel at: Cron Jobs - Version 70 Documentation - cPanel Documentation As far as how to develop the script itself, StackOverflow is likely your best resource for development-related questions. Here's an example of a discussion there: Bash: Check if file was modified since used in script Thank you.
    0
  • ATom1
    I have created a cron job as follows: /usr/bin/php -q /home2/myusrname/public_html/CheckHome.php >/dev/null
    Here is the CheckHome.php file contents: 5) { mail("1234567890@txt.att.net","Alert",$msg); } ?>
    I tested the php script independently, so I know it works. However, I am not getting a text when the file is not being updated. The file is normally updated once per minute.
    0
  • ATom1
    It is working now; seems like it took a while for the cron job to commence.
    0
  • cPanelMichael
    It is working now; seems like it took a while for the cron job to commence.

    Hello, I'm glad to see it's working well. I've marked this thread as solved. Thanks!
    0

Please sign in to leave a comment.