SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    Non-Member slr's Avatar
    Join Date
    Oct 2013
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    crontab -e, mail not delivered

    On my virtual private linux centos 5.x server i did command "crontab -e"
    the file was empty, i added this:

    MAILFROM="mymailhere@gmail.com"
    MAILTO="mymailhere@gmail.com"
    # */1 * * * * bash /temporarillydeactivated/
    */1 * * * * /temporarilydeactivate/ >/dev/null 2>&1
    */1 * * * * /root/dom/scriptxy.sh# >/dev/null 2>&1
    # * * * * * sleep 30; /root/script.sh >/dev/null 2>&1
    Please why no mail arriving to mymailhere@gmail.com? i checked and command: echo "body" | mail -s "subject" mymailhere@gmail.com delivers email OK..

  2. #2
    Utopia, Inc. silver trophy
    ScallioXTX's Avatar
    Join Date
    Aug 2008
    Location
    The Netherlands
    Posts
    8,903
    Mentioned
    138 Post(s)
    Tagged
    2 Thread(s)
    cron emails you the output of any script it runs (if there is any). Since you're routing all output to /dev/null, you will never get any email because there is nothing to email.
    Rémon - Hosting Advisor

    Minimal Bookmarks Tree
    My Google Chrome extension: browsing bookmarks made easy

  3. #3
    Non-Member slr's Avatar
    Join Date
    Oct 2013
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ScallioXTX View Post
    Since you're routing all output to /dev/null, you will never get any email because there is nothing to email.
    my command is /root/dom/scriptxy.sh# >/dev/null 2>&1

    notice "#"

  4. #4
    Utopia, Inc. silver trophy
    ScallioXTX's Avatar
    Join Date
    Aug 2008
    Location
    The Netherlands
    Posts
    8,903
    Mentioned
    138 Post(s)
    Tagged
    2 Thread(s)
    Comment in cron only work at the start of the line, not half way like you have since cron wil just pass it on to the command verbatim
    Rémon - Hosting Advisor

    Minimal Bookmarks Tree
    My Google Chrome extension: browsing bookmarks made easy


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •