Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: cron email stopped

  1. #1

    Default cron email stopped

    Hello - I was wondering if anyone has any advice on cron. I've been using a "user cron job" to run two scripts daily, and a "root cron job" to shut down the computer after the scripts run. It has worked well for months and I could check the output in /var/mail/user. Then, suddenly, a couple of weeks ago, the user cron job stopped sending emails with STDIO/STDERR outputs to the user. (in /var/mail/user dir) I haven't been able to find this exact problem on the interwebs, and I need to fix this before I can start troubleshooting one of the scripts. The cron daemon seems to be running as at least one of the scripts is running, but another one is not, and I can't troubleshoot without the outputs I used to find in /var/mail/user.

    (This is a single system with only one user - /etc/crontab wasn't edited so apparently that's the 'MAILTO=' that's always been there.)

    (should SHELL=/bin/bash ?)

    /etc/crontab
    Code:
    SHELL=/bin/sh
    PATH=/usr/bin:/usr/sbin:/sbin:/bin:/usr/lib/news/bin
    MAILTO=root
    #
    # check scripts in cron.hourly, cron.daily, cron.weekly, and cron.monthly
    #
    -*/15 * * * *   root  test -x /usr/lib/cron/run-crons && /usr/lib/cron/run-crons >/dev/null 2>&1
    >> crontab -e
    Code:
    00 02 * * * /home/user/00_Python/00__RunEMS+Process+upl.txt
    30 06 * * * /home/user/00_Python/00__AutoUPL.txt
    ~   
    ~

  2. #2
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    31,277
    Blog Entries
    15

    Default Re: cron email stopped

    Hi
    Is postfix running ok?

    Code:
    systemctl status postfix
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  3. #3

    Default Re: cron email stopped

    hmmm...

    Code:
    ● postfix.service - Postfix Mail Transport Agent
       Loaded: loaded (/usr/lib/systemd/system/postfix.service; enabled; vendor preset: enabled)
       Active: failed (Result: exit-code) since Sun 2021-04-11 08:36:59 MST; 1min 45s ago
      Process: 1929 ExecStopPost=/etc/postfix/system/cond_slp deregister (code=exited, status=0/SUCCESS)
      Process: 1850 ExecStart=/usr/sbin/postfix start (code=exited, status=1/FAILURE)
    Tried starting and status...
    Code:
    ● postfix.service - Postfix Mail Transport Agent
       Loaded: loaded (/usr/lib/systemd/system/postfix.service; enabled; vendor preset: enabled)
       Active: failed (Result: exit-code) since Sun 2021-04-11 08:36:59 MST; 7min ago
    
    Apr 11 08:36:57 linux-8e6p systemd[1]: Starting Postfix Mail Transport Agent...
    Apr 11 08:36:57 linux-8e6p echo[1829]: Starting mail service (Postfix)
    Apr 11 08:36:57 linux-8e6p postfix[1850]: fatal: parameter inet_interfaces: no local interface found for ::1
    Apr 11 08:36:58 linux-8e6p systemd[1]: postfix.service: Control process exited, code=exited status=1
    Apr 11 08:36:58 linux-8e6p cond_slp[1929]: /usr/sbin/postconf: fatal: parameter inet_interfaces: no local interface found for ::1
    Apr 11 08:36:59 linux-8e6p systemd[1]: Failed to start Postfix Mail Transport Agent.
    Apr 11 08:36:59 linux-8e6p systemd[1]: postfix.service: Unit entered failed state.
    Apr 11 08:36:59 linux-8e6p systemd[1]: postfix.service: Failed with result 'exit-code'.
    Is this an "old distro" problem?

  4. #4

    Default Re: cron email stopped

    Let me see if I can get postfix running again... that reference to ::1 troubles me - it seems to be present in /etc/hosts.

    EDIT: OK, I looked in /etc/hosts and the reference to the IP6 thingie "::1" was there. Then on a hunch I opened YaST/wicked and saw that the "Enable IP6" checkbox in Global Settings was unchecked. So I figure I must have unchecked that... So I checked it and rebooted. Now Postfix gets enabled without error upon reboot. That "may" solve the problem. Thank you for suggesting Postfix - I never would have guessed.

  5. #5
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    31,277
    Blog Entries
    15

    Default Re: cron email stopped

    Quote Originally Posted by pattiM View Post
    Let me see if I can get postfix running again... that reference to ::1 troubles me - it seems to be present in /etc/hosts.

    EDIT: OK, I looked in /etc/hosts and the reference to the IP6 thingie "::1" was there. Then on a hunch I opened YaST/wicked and saw that the "Enable IP6" checkbox in Global Settings was unchecked. So I figure I must have unchecked that... So I checked it and rebooted. Now Postfix gets enabled without error upon reboot. That "may" solve the problem. Thank you for suggesting Postfix - I never would have guessed.
    Hi
    Have you edited /etc/postfix/main.cf to change the line inet_protocols = all to ipv4?

    Code:
    cat /etc/postfix/main.cf | grep inet_protocol
    
    inet_protocols = ipv4
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  6. #6

    Default Re: cron email stopped

    OK - just checking the "Enable IP6" option in YaST solved the problem. Thank you!! (Is there a problem with having IP6 enabled?)

    Now I just have to figure out why the FTP connection to the cloud server is so flaky. About 1/3rd of the time, mput just times out. So I usually have to run the FTP upload script a few of times to make sure the cron FTP transfer finishes.


  7. #7
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    31,277
    Blog Entries
    15

    Default Re: cron email stopped

    Quote Originally Posted by pattiM View Post
    OK - just checking the "Enable IP6" option in YaST solved the problem. Thank you!! (Is there a problem with having IP6 enabled?)

    Now I just have to figure out why the FTP connection to the cloud server is so flaky. About 1/3rd of the time, mput just times out. So I usually have to run the FTP upload script a few of times to make sure the cron FTP transfer finishes.

    Hi
    I would disable in main.cf.... Does the cloud offer sftp (secure ftp)?
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  8. #8

    Default Re: cron email stopped

    So I hear you saying to uncheck "Enable IP6" box in YaST Global Options, and to set
    Code:
    inet_protocols = ipv4
    ... in postfix (right now inet_protocols is commented-out in that config file). So I take this to mean IPv6 might be a security hole.

    The data aren't sensitive - my security concerns are the plaintext FTP password might assist someone in attacking the server/webpage or other such. I believe they do support standard SFTP, but it was pretty tricky to find an FTP mput script recommendation online (that I could understand). I haven't been able to find an sftp script, so that's sort of an ongoing project.
    I've been using a sort of standard format...
    Code:
    HOST='ftp.email.add'
    USER='email@email.add'
    PASSWD='24398868'
    FILE1='RH.webm'
    FILE2='SWDOWNA.webm'
    /usr/bin/ftp -ni $HOST <<END_SCRIPT
    quote USER $USER
    quote PASS $PASSWD
    binary
    mput $FILE1 $FILE2 
    quit

  9. #9
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    31,277
    Blog Entries
    15

    Default Re: cron email stopped

    Quote Originally Posted by pattiM View Post
    So I hear you saying to uncheck "Enable IP6" box in YaST Global Options, and to set
    Code:
    inet_protocols = ipv4
    ... in postfix (right now inet_protocols is commented-out in that config file). So I take this to mean IPv6 might be a security hole.

    The data aren't sensitive - my security concerns are the plaintext FTP password might assist someone in attacking the server/webpage or other such. I believe they do support standard SFTP, but it was pretty tricky to find an FTP mput script recommendation online (that I could understand). I haven't been able to find an sftp script, so that's sort of an ongoing project.
    I've been using a sort of standard format...
    Code:
    HOST='ftp.email.add'
    USER='email@email.add'
    PASSWD='24398868'
    FILE1='RH.webm'
    FILE2='SWDOWNA.webm'
    /usr/bin/ftp -ni $HOST <<END_SCRIPT
    quote USER $USER
    quote PASS $PASSWD
    binary
    mput $FILE1 $FILE2 
    quit
    Hi
    Then look at perl it is far more robust...

    https://www.example-code.com/perl/sftp.asp
    https://www.example-code.com/perl/ftp.asp
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  10. #10

    Default Re: cron email stopped

    ... there seem to be a dizzying array of options, SFTP, FTPS, LFTP, ... then, deeper things like use of SSH, TLS, etc. I'm really only concerned about the plaintext FTP password (although I am no security expert!).

Page 1 of 2 12 LastLast

Posting Permissions

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