Re: user crontab
On 2020-05-11 21:45, Robert Moskowitz wrote: > > > On 5/11/20 9:28 AM, Ed Greshko wrote: >> On 2020-05-11 20:39, Robert Moskowitz wrote: >>> And now you are paying the memory, cpu, etc. cost of having postfix running >> Oh, well, I suppose I've never seen an idle postfix take up any noticeable >> CPU time or memory >> on any of my systems. > > How can it not take up memory? It may be swapped out, but there should be > something there watching port 25, at least. It is rather tiny. Taking up 0.7% of memory in a VM with 1.2G assigned to it. > > It does seem to be event triggered, like a connection to port 25 or whatever > other ports it is configured for. So it would be idling for the post part. > But then when you use it for a simple MDA action, is it written modularly so > you only load what is needed? > > Yeah, not too bad. But to configure postfix for only this function and to > protect against any misuse, is yet something else to do. Misuse? Listening only on 127.0.0.1 by default so only users on the machine it is running can abuse it. :-) > > Plus writing my own script has been fun and educational! ;) Sounds like lots of fun. > > The problem is with cron. I am going to have to drop a note to Vixie; it has > been a couple years since the two of us have had fun sparing... really he is > a great guy, and I learned a lot from him working on IETF mail and dns > workgroups. > Well, since cronie is a fork of vixie-cron he may not have much insight. -- The key to getting good answers is to ask good questions. ___ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Re: user crontab
On 5/11/20 9:28 AM, Ed Greshko wrote: On 2020-05-11 20:39, Robert Moskowitz wrote: And now you are paying the memory, cpu, etc. cost of having postfix running Oh, well, I suppose I've never seen an idle postfix take up any noticeable CPU time or memory on any of my systems. How can it not take up memory? It may be swapped out, but there should be something there watching port 25, at least. It does seem to be event triggered, like a connection to port 25 or whatever other ports it is configured for. So it would be idling for the post part. But then when you use it for a simple MDA action, is it written modularly so you only load what is needed? Yeah, not too bad. But to configure postfix for only this function and to protect against any misuse, is yet something else to do. Plus writing my own script has been fun and educational! ;) The problem is with cron. I am going to have to drop a note to Vixie; it has been a couple years since the two of us have had fun sparing... really he is a great guy, and I learned a lot from him working on IETF mail and dns workgroups. ___ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Re: user crontab
On 2020-05-11 20:39, Robert Moskowitz wrote: > And now you are paying the memory, cpu, etc. cost of having postfix running Oh, well, I suppose I've never seen an idle postfix take up any noticeable CPU time or memory on any of my systems. -- The key to getting good answers is to ask good questions. ___ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Re: user crontab
On 5/10/20 11:39 PM, Ed Greshko wrote: On 2020-05-07 06:00, Robert Moskowitz wrote: I know I can edit the user crontab with: crontab -e and display it with crontab -l But where is it? I don't see anything like ~/.crontab Secondly, and more importantly, is getting a email from the user crontab. I have in my crontab: SHELL=/bin/bash PATH=/sbin:/bin:/usr/sbin:/usr/bin MAILTO=rgm And nothing gets mailed to /var/spool/mail/rgm ls /var/spool/mail/ -ls total 0 0 -rw-rw. 1 rgm mail 0 May 5 17:21 rgm 0 -rw-rw. 1 rpc mail 0 May 5 17:07 rpc Do I need something like postfix with a minimal installation to get the output from my crontab? Sorry to be "late to the party". I did the following dnf install postfix systemctl --now enable postfix And now you are paying the memory, cpu, etc. cost of having postfix running for something that a postprocessing MDA should/can do. Plus you are showing that cron is not working "out of the box" as well as it should without an MTA or a proper MDA. My crontab SHELL=/bin/sh MAILTO=egreshko 37 * * * * /home/egreshko/bin/tippy Contents of /home/egreshko/bin/tippy [egreshko@f31k ~]$ cat bin/tippy #!/bin/sh echo HI ls /tmp And then you can see the time has past with... [egreshko@f31k ~]$ date Mon 11 May 2020 11:38:01 AM CST And this showed up in local mailbox [egreshko@f31k ~]$ cat /var/spool/mail/egreshko From egres...@f31k.greshko.com Mon May 11 11:37:01 2020 Return-Path: X-Original-To: egreshko Delivered-To: egres...@f31k.greshko.com Received: by f31k.greshko.com (Postfix, from userid 1026) id 61824A7C95; Mon, 11 May 2020 11:37:01 +0800 (CST) From: "(Cron Daemon)" To: egres...@f31k.greshko.com Subject: Cron /home/egreshko/bin/tippy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Auto-Submitted: auto-generated Precedence: bulk X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: Message-Id: <20200511033701.61824a7...@f31k.greshko.com> Date: Mon, 11 May 2020 11:37:01 +0800 (CST) HI sddm-:0-WDrvkF sddm-auth43c5c6d5-ceb7-4e5b-b09f-abe5c864fba1 systemd-private-a3fcb3cdd0024b53828446634851314a-chronyd.service-5olExh systemd-private-a3fcb3cdd0024b53828446634851314a-colord.service-759pOi systemd-private-a3fcb3cdd0024b53828446634851314a-dbus-broker.service-2c7ROg systemd-private-a3fcb3cdd0024b53828446634851314a-ModemManager.service-e8g5zi systemd-private-a3fcb3cdd0024b53828446634851314a-postfix.service-tkOnQf systemd-private-a3fcb3cdd0024b53828446634851314a-rtkit-daemon.service-vXKr2h systemd-private-a3fcb3cdd0024b53828446634851314a-systemd-logind.service-jmYKHf systemd-private-a3fcb3cdd0024b53828446634851314a-upower.service-24SETg Isn't that what you wanted? Without the fun and games of an MTA. I could easily do this. I have done this for past installs. This time I am trying to figure this out without the MTA bandaid; an MDA like procmail SHOULD do this right. In fact someone did part of the job by adding the "-f cron" option to procmail. ___ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Re: user crontab
On 2020-05-07 06:00, Robert Moskowitz wrote: > I know I can edit the user crontab with: > > crontab -e > > and display it with > > crontab -l > > But where is it? I don't see anything like ~/.crontab > > Secondly, and more importantly, is getting a email from the user crontab. I > have in my crontab: > > SHELL=/bin/bash > PATH=/sbin:/bin:/usr/sbin:/usr/bin > MAILTO=rgm > > > And nothing gets mailed to /var/spool/mail/rgm > > ls /var/spool/mail/ -ls > total 0 > 0 -rw-rw. 1 rgm mail 0 May 5 17:21 rgm > 0 -rw-rw. 1 rpc mail 0 May 5 17:07 rpc > > > Do I need something like postfix with a minimal installation to get the > output from my crontab? > Sorry to be "late to the party". I did the following dnf install postfix systemctl --now enable postfix My crontab SHELL=/bin/sh MAILTO=egreshko 37 * * * * /home/egreshko/bin/tippy Contents of /home/egreshko/bin/tippy [egreshko@f31k ~]$ cat bin/tippy #!/bin/sh echo HI ls /tmp And then you can see the time has past with... [egreshko@f31k ~]$ date Mon 11 May 2020 11:38:01 AM CST And this showed up in local mailbox [egreshko@f31k ~]$ cat /var/spool/mail/egreshko From egres...@f31k.greshko.com Mon May 11 11:37:01 2020 Return-Path: X-Original-To: egreshko Delivered-To: egres...@f31k.greshko.com Received: by f31k.greshko.com (Postfix, from userid 1026) id 61824A7C95; Mon, 11 May 2020 11:37:01 +0800 (CST) From: "(Cron Daemon)" To: egres...@f31k.greshko.com Subject: Cron /home/egreshko/bin/tippy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Auto-Submitted: auto-generated Precedence: bulk X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: Message-Id: <20200511033701.61824a7...@f31k.greshko.com> Date: Mon, 11 May 2020 11:37:01 +0800 (CST) HI sddm-:0-WDrvkF sddm-auth43c5c6d5-ceb7-4e5b-b09f-abe5c864fba1 systemd-private-a3fcb3cdd0024b53828446634851314a-chronyd.service-5olExh systemd-private-a3fcb3cdd0024b53828446634851314a-colord.service-759pOi systemd-private-a3fcb3cdd0024b53828446634851314a-dbus-broker.service-2c7ROg systemd-private-a3fcb3cdd0024b53828446634851314a-ModemManager.service-e8g5zi systemd-private-a3fcb3cdd0024b53828446634851314a-postfix.service-tkOnQf systemd-private-a3fcb3cdd0024b53828446634851314a-rtkit-daemon.service-vXKr2h systemd-private-a3fcb3cdd0024b53828446634851314a-systemd-logind.service-jmYKHf systemd-private-a3fcb3cdd0024b53828446634851314a-upower.service-24SETg Isn't that what you wanted? -- The key to getting good answers is to ask good questions. ___ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Re: Working! - Re: user crontab
On 5/10/20 6:51 PM, Cameron Simpson wrote: On 10May2020 13:36, Robert Moskowitz wrote: It is entirely true. The collapsing happens when you _use_ the values: # all safe and reliable $ a=$( date +'%a %b %d %T %Y') $ b=$( date +'%a %b %d %T Y') $ c=$b # unquoted use $ echo $a Sat May 09 14:37:07 2020 $ echo $b Sat May 09 14:37:15 2020 $ echo $c Sat May 09 14:37:15 2020 # quoted use $ echo "$a" Sat May 09 14:37:07 2020 $ echo "$b" Sat May 09 14:37:15 2020 $ echo "$c" Sat May 09 14:37:15 2020 The variable $b contains the multiple spaces you put in your date format. But they only survive is you quote the variable when you use it. [...] I am having problems taking out the ' You've misread things. Keep the ' quote, it is needed so that the '+.' argument remains _one_ argument to the date command. We're talking about dropping the " from the "$(...)" part. So change: currentDate="$(date +'%a %b %d %T %Y')" into: currentDate=$(date +'%a %b %d %T %Y')" which does not need the double quotes because the shell parses currentDate=$(..) as the assignment because of the punctuation. Thanks! This was explained off list. Got it and fixed! ___ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Re: Working! - Re: user crontab
On 10May2020 13:36, Robert Moskowitz wrote: It is entirely true. The collapsing happens when you _use_ the values: # all safe and reliable $ a=$( date +'%a %b %d %T %Y') $ b=$( date +'%a %b %d %T Y') $ c=$b # unquoted use $ echo $a Sat May 09 14:37:07 2020 $ echo $b Sat May 09 14:37:15 2020 $ echo $c Sat May 09 14:37:15 2020 # quoted use $ echo "$a" Sat May 09 14:37:07 2020 $ echo "$b" Sat May 09 14:37:15 2020 $ echo "$c" Sat May 09 14:37:15 2020 The variable $b contains the multiple spaces you put in your date format. But they only survive is you quote the variable when you use it. [...] I am having problems taking out the ' You've misread things. Keep the ' quote, it is needed so that the '+.' argument remains _one_ argument to the date command. We're talking about dropping the " from the "$(...)" part. So change: currentDate="$(date +'%a %b %d %T %Y')" into: currentDate=$(date +'%a %b %d %T %Y')" which does not need the double quotes because the shell parses currentDate=$(..) as the assignment because of the punctuation. Cheers, Cameron Simpson ___ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Re: Working! - Re: user crontab
On 5/9/20 12:41 AM, Cameron Simpson wrote: On 08May2020 20:32, Samuel Sieb wrote: On 5/8/20 4:32 PM, Cameron Simpson wrote: On 08May2020 11:15, Robert Moskowitz wrote: I added inserting a Date: line and switched to using sed: local]# cat mycron #!/bin/sh currentDate="$(date +'%a %b %d %T %Y')" You don't need the double quotes. The shell parser recognises the assignment statement _before_ breaking things on whitespace. That's not entirely true. It will compress whitespace in the output if you don't use quotes. $(date +'%a %b %d %T %Y') $(date +'%a %b %d %T %Y') will end up exactly the same without the double quotes around it. It is entirely true. The collapsing happens when you _use_ the values: # all safe and reliable $ a=$( date +'%a %b %d %T %Y') $ b=$( date +'%a %b %d %T Y') $ c=$b # unquoted use $ echo $a Sat May 09 14:37:07 2020 $ echo $b Sat May 09 14:37:15 2020 $ echo $c Sat May 09 14:37:15 2020 # quoted use $ echo "$a" Sat May 09 14:37:07 2020 $ echo "$b" Sat May 09 14:37:15 2020 $ echo "$c" Sat May 09 14:37:15 2020 The variable $b contains the multiple spaces you put in your date format. But they only survive is you quote the variable when you use it. So the assignment statements do not need the quotes because of how the parsing is done. Word separation happens in command _usage_ if you don't quote because the shell is in some ways a macro language. But $b contains the multiple spaces unharmed, you just have to not use it in a destructive way (== unquoted). I am having problems taking out the ' I set up a little script and run it: $ cat mcron #!/bin/sh currentDate="$(date +'%a %b %d %T %Y')" echo "From cron@localhost $currentDate" [rgm@lx140e ~]$ ./mcron From cron@localhost Sun May 10 13:28:59 2020 Then I take out the ' $ cat mcron #!/bin/sh currentDate="$(date +%a %b %d %T %Y)" echo "From cron@localhost $currentDate" [rgm@lx140e ~]$ ./mcron date: extra operand ‘%b’ Try 'date --help' for more information. From cron@localhost I tried taking out the " as in your example and still get the error. So I tried the %_b from the man and not dice: $ cat mcron #!/bin/sh currentDate=$(date +%_a%_b%_d%_T%_Y) echo "From cron@localhost $currentDate" [rgm@lx140e ~]$ ./mcron From cron@localhost SunMay1013:34:282020 So I am missing something compared to your experience. ___ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Re: Working! - Re: user crontab
On 5/8/20 9:41 PM, Cameron Simpson wrote: On 08May2020 20:32, Samuel Sieb wrote: On 5/8/20 4:32 PM, Cameron Simpson wrote: On 08May2020 11:15, Robert Moskowitz wrote: I added inserting a Date: line and switched to using sed: local]# cat mycron #!/bin/sh currentDate="$(date +'%a %b %d %T %Y')" You don't need the double quotes. The shell parser recognises the assignment statement _before_ breaking things on whitespace. That's not entirely true. It will compress whitespace in the output if you don't use quotes. $(date +'%a %b %d %T %Y') $(date +'%a %b %d %T %Y') will end up exactly the same without the double quotes around it. It is entirely true. The collapsing happens when you _use_ the values: Sorry, you are correct. I got tripped up by how I used the variable after setting it. ___ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Re: Working! - Re: user crontab
On 08May2020 20:32, Samuel Sieb wrote: On 5/8/20 4:32 PM, Cameron Simpson wrote: On 08May2020 11:15, Robert Moskowitz wrote: I added inserting a Date: line and switched to using sed: local]# cat mycron #!/bin/sh currentDate="$(date +'%a %b %d %T %Y')" You don't need the double quotes. The shell parser recognises the assignment statement _before_ breaking things on whitespace. That's not entirely true. It will compress whitespace in the output if you don't use quotes. $(date +'%a %b %d %T %Y') $(date +'%a %b %d %T %Y') will end up exactly the same without the double quotes around it. It is entirely true. The collapsing happens when you _use_ the values: # all safe and reliable $ a=$( date +'%a %b %d %T %Y') $ b=$( date +'%a %b %d %T Y') $ c=$b # unquoted use $ echo $a Sat May 09 14:37:07 2020 $ echo $b Sat May 09 14:37:15 2020 $ echo $c Sat May 09 14:37:15 2020 # quoted use $ echo "$a" Sat May 09 14:37:07 2020 $ echo "$b" Sat May 09 14:37:15 2020 $ echo "$c" Sat May 09 14:37:15 2020 The variable $b contains the multiple spaces you put in your date format. But they only survive is you quote the variable when you use it. So the assignment statements do not need the quotes because of how the parsing is done. Word separation happens in command _usage_ if you don't quote because the shell is in some ways a macro language. But $b contains the multiple spaces unharmed, you just have to not use it in a destructive way (== unquoted). Cheers, Cameron Simpson ___ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Re: Working! - Re: user crontab
On 5/8/20 4:32 PM, Cameron Simpson wrote: On 08May2020 11:15, Robert Moskowitz wrote: I added inserting a Date: line and switched to using sed: local]# cat mycron #!/bin/sh currentDate="$(date +'%a %b %d %T %Y')" You don't need the double quotes. The shell parser recognises the assignment statement _before_ breaking things on whitespace. That's not entirely true. It will compress whitespace in the output if you don't use quotes. $(date +'%a %b %d %T %Y') $(date +'%a %b %d %T %Y') will end up exactly the same without the double quotes around it. ___ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Re: Working! - Re: user crontab
On 08May2020 11:15, Robert Moskowitz wrote: I added inserting a Date: line and switched to using sed: local]# cat mycron #!/bin/sh currentDate="$(date +'%a %b %d %T %Y')" You don't need the double quotes. The shell parser recognises the assignment statement _before_ breaking things on whitespace. echo "From cron@localhost $currentDate" >> /var/spool/mail/$USER currentDate="$(date +'%a,%e %b %Y %T %z (%Z)')" Again, double quotes not needed. sed "/^Status:/a Date: $currentDate" >> /var/spool/mail/$USER You can just use echo; the Date: header does not need to be in a specific position. echo "" >> /var/spool/mail/$USER You do a lot of explicit >>mailfile. Try this: exec 3>>"/var/spool/mail/$USER" ... script ... and just put ">&3" instead of ">>/var/spool/mail/$USER". More readable, avoids typos, avoids gratiuitous extra opening of the mail file per command. Cheers, Cameron Simpson ___ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Re: Working! - Re: user crontab
On 08May2020 06:59, Robert Moskowitz wrote: On 5/8/20 2:24 AM, Gordon Messmer wrote: On 5/7/20 10:44 PM, Jon LaBadie wrote: In my mail files each message is followed by a blank line before the next "From_" line. Is that a requirement of mbox format? If so, it may be necessary to add it to the crontab output. Yes, it's a requirement of the format. That's why there's an "echo" after "cat". :) Oops. That is right. And I need to change this to do a sed to insert a Date: line in the right place... "The right place"? You can do it with echo, just make it the first header. Cheers, Cameron Simpson ___ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Re: Working! - Re: user crontab
On 08May2020 06:56, Robert Moskowitz wrote: On 5/8/20 2:08 AM, Cameron Simpson wrote: You _do_ need to ensure the message at least ends with a newline, of the From_ won't be at the start of a line. So the previously posted script ensures that with the "echo" in "( cat; echo )". If you want to ensure a blank line you also need an additional "echo". Working on it. Plus I have to sed in a Date: line. Note that the From_ line uses a UNIX ctime format date, while all the dates in the message headers use the RFC5322 date format, described here: https://tools.ietf.org/rfcmarkup/5322#page-14 Or Robert could install an MDA and make it the MDA's problem :-) What fun would that be? Plus I have always thought of this as a deficiency in cron on a workstation. Cron should work (report in this case) properly without needing something else (MTA) installed. Maybe the developers will pick this up and do it right... Except that sending an email to the user is close to an _ideal_ way to send a chunk of output from an unattended task. A proper UNIX system has an email system supplied IMO. Why not use it? By what mechanism would you prefer it report? syslog (gah!)? Writing to a log file is easily done just by prefixing the shell line with a redirection to a file, eg change: * * * * * shell command ... to: * * * * * exec >>$HOME/var/log/cron/"`date`.log" 2>&1; shell command ... What other sophistication do you seek? Cheers, Cameron Simpson ___ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Re: Working! - Re: user crontab
On 5/8/20 11:08 AM, Robert Moskowitz wrote: On 5/8/20 1:58 PM, Mike Wright wrote: There's a tiny MDA called femtomail that delivers into a Maildir. Well first I need mbox, not maildir format. mutt can read Maildir as well. Maildir is a much better mail storage method than mbox. Provide it a USERNAME and MAILBOX_PATH and do a make and it will produce a binary (back in 2016 it was 38724 bytes) usable for the specified user. It does not seem to be in the F32 repos, so I would have to make it. It's only a couple of files, trivial to build. It's not something that could be packaged because you have to adjust a couple of settings like the username before compiling. And yes, I understand that learning to make your own simple MDA can be fun as well. ___ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Re: Working! - Re: user crontab
On 5/8/20 2:01 PM, Samuel Sieb wrote: On 5/8/20 10:58 AM, Mike Wright wrote: On 5/8/20 9:55 AM, Robert Moskowitz wrote: On 5/8/20 12:39 PM, Tim via users wrote: On Fri, 2020-05-08 at 06:56 -0400, Robert Moskowitz wrote: Plus I have always thought of this as a deficiency in cron on a workstation. Cron should work (report in this case) properly without needing something else (MTA) installed. Does it though? There's always /var/log/cron. Or that other journal log thing that is too convoluted for me to want to use. It depends on what you are doing in your cron scripts. It can be argued that mine really don't need to go to emails, but I decided to do it... There's a tiny MDA called femtomail that delivers into a Maildir. I linked to that project much earlier in this thread. Yes, and I do remember that... but I would have to get the source and the rest of that. What I am doing is more interesting; for now. ___ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Re: Working! - Re: user crontab
On 5/8/20 1:58 PM, Mike Wright wrote: On 5/8/20 9:55 AM, Robert Moskowitz wrote: On 5/8/20 12:39 PM, Tim via users wrote: On Fri, 2020-05-08 at 06:56 -0400, Robert Moskowitz wrote: Plus I have always thought of this as a deficiency in cron on a workstation. Cron should work (report in this case) properly without needing something else (MTA) installed. Does it though? There's always /var/log/cron. Or that other journal log thing that is too convoluted for me to want to use. It depends on what you are doing in your cron scripts. It can be argued that mine really don't need to go to emails, but I decided to do it... There's a tiny MDA called femtomail that delivers into a Maildir. Well first I need mbox, not maildir format. Provide it a USERNAME and MAILBOX_PATH and do a make and it will produce a binary (back in 2016 it was 38724 bytes) usable for the specified user. It does not seem to be in the F32 repos, so I would have to make it. sendmail is 4.5M, dovecot is almost 10M, postfix is almost 5M. Comparatively femtomail is miniscule. Now I realize that comparing femtomail to those is like comparing a checker player to a chess master but it does look like it might fit the bill. Something to think about. ___ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Re: Working! - Re: user crontab
On 5/8/20 10:58 AM, Mike Wright wrote: On 5/8/20 9:55 AM, Robert Moskowitz wrote: On 5/8/20 12:39 PM, Tim via users wrote: On Fri, 2020-05-08 at 06:56 -0400, Robert Moskowitz wrote: Plus I have always thought of this as a deficiency in cron on a workstation. Cron should work (report in this case) properly without needing something else (MTA) installed. Does it though? There's always /var/log/cron. Or that other journal log thing that is too convoluted for me to want to use. It depends on what you are doing in your cron scripts. It can be argued that mine really don't need to go to emails, but I decided to do it... There's a tiny MDA called femtomail that delivers into a Maildir. I linked to that project much earlier in this thread. ___ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Re: Working! - Re: user crontab
On 5/8/20 9:55 AM, Robert Moskowitz wrote: On 5/8/20 12:39 PM, Tim via users wrote: On Fri, 2020-05-08 at 06:56 -0400, Robert Moskowitz wrote: Plus I have always thought of this as a deficiency in cron on a workstation. Cron should work (report in this case) properly without needing something else (MTA) installed. Does it though? There's always /var/log/cron. Or that other journal log thing that is too convoluted for me to want to use. It depends on what you are doing in your cron scripts. It can be argued that mine really don't need to go to emails, but I decided to do it... There's a tiny MDA called femtomail that delivers into a Maildir. Provide it a USERNAME and MAILBOX_PATH and do a make and it will produce a binary (back in 2016 it was 38724 bytes) usable for the specified user. sendmail is 4.5M, dovecot is almost 10M, postfix is almost 5M. Comparatively femtomail is miniscule. Now I realize that comparing femtomail to those is like comparing a checker player to a chess master but it does look like it might fit the bill. ___ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Re: Working! - Re: user crontab
On 5/8/20 12:39 PM, Tim via users wrote: On Fri, 2020-05-08 at 06:56 -0400, Robert Moskowitz wrote: Plus I have always thought of this as a deficiency in cron on a workstation. Cron should work (report in this case) properly without needing something else (MTA) installed. Does it though? There's always /var/log/cron. Or that other journal log thing that is too convoluted for me to want to use. It depends on what you are doing in your cron scripts. It can be argued that mine really don't need to go to emails, but I decided to do it... ___ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Re: Working! - Re: user crontab
On Fri, 2020-05-08 at 06:56 -0400, Robert Moskowitz wrote: > Plus I have always thought of this as a deficiency in cron on a > workstation. Cron should work (report in this case) properly > without needing something else (MTA) installed. Does it though? There's always /var/log/cron. Or that other journal log thing that is too convoluted for me to want to use. -- uname -rsvp Linux 3.10.0-1127.el7.x86_64 #1 SMP Tue Mar 31 23:36:51 UTC 2020 x86_64 Boilerplate: All unexpected mail to my mailbox is automatically deleted. I will only get to see the messages that are posted to the mailing list. ___ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Re: Working! - Re: user crontab
On 5/8/20 10:03 AM, Jon LaBadie wrote: On Thu, May 07, 2020 at 11:24:41PM -0700, Gordon Messmer wrote: On 5/7/20 10:44 PM, Jon LaBadie wrote: In my mail files each message is followed by a blank line before the next "From_" line. Is that a requirement of mbox format? If so, it may be necessary to add it to the crontab output. Yes, it's a requirement of the format. That's why there's an "echo" after "cat". :) except cat is not guarenteed to EOF after a newline. New script. I added inserting a Date: line and switched to using sed: local]# cat mycron #!/bin/sh currentDate="$(date +'%a %b %d %T %Y')" echo "From cron@localhost $currentDate" >> /var/spool/mail/$USER currentDate="$(date +'%a,%e %b %Y %T %z (%Z)')" sed "/^Status:/a Date: $currentDate" >> /var/spool/mail/$USER echo "" >> /var/spool/mail/$USER == Took a bit to get the date function outputing the right formats. I still suspect I am missing an important mail header. Mutt takes a long time to start up compared to a CentOS system that DOES have postfix and cron is sending the mail to local store. ___ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Re: Working! - Re: user crontab
On Thu, May 07, 2020 at 11:24:41PM -0700, Gordon Messmer wrote: > On 5/7/20 10:44 PM, Jon LaBadie wrote: > > In my mail files each message is followed by a blank line > > before the next "From_" line. Is that a requirement of > > mbox format? If so, it may be necessary to add it to > > the crontab output. > > > Yes, it's a requirement of the format. That's why there's an "echo" after > "cat". :) except cat is not guarenteed to EOF after a newline. -- Jon H. LaBadie jo...@jgcomp.com ___ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Re: Working! - Re: user crontab
On 5/8/20 6:04 AM, Tim via users wrote: On Fri, 2020-05-08 at 01:44 -0400, Jon LaBadie wrote: In my mail files each message is followed by a blank line before the next "From_" line. Is that a requirement of mbox format? If so, it may be necessary to add it to the crontab output. It's how mbox works, each email is concatenated into one huge file, and that's the separator (a blank line, then a "from" line at the beginning of the next message). i.e. It's an mbox thing, not a general email thing. Of course, it's entirely possible for someone to write an email, starting off a new paragraph with the word from, and that'll confuse the heck of dumbly written email software. Typically, they'll split the email there, you'll only see what appeared before it, and the rest of the mail will be completely lost. Well I kind of just did exactly that by pasteing in an email that was in the mbox! Of course, I am sending email with rich html, so it is not received as just a plain text file to mess up anyone using an mbox reader. Got to love this stuff. Otherwise you would go crazier! I say dumb, because it's well known that people might write an email that way, they should't have to word their emails some other way, and email software should be able to handle it, one way or another. The usual way is that some mail handler will add a character into the text, somewhere, to make it different (e.g. shove a > in front, or add another character after the word from). That could be your own email program, munging the message as it sends it (another dumb thing), or it could be an email server munging messages as it passes through them knowing that *it* is going to store its messages in a mbox file (just acceptable), or some email server munging messages passing through it in case some other mail server can't handle it (another dumb thing). Another way of handling it is for your mail server to not use a from line, and be able to ignore the word "from" appearing in a message. Whether that be using some other non-standard message separation method of their own, or an addition (such as adding details to the "from line" about the length of the message, so the server doesn't break apart messages when the word "from" appears before the end of the message), or a different mail storage technique. e.g. Maildir stores each email as a separate file, so doesn't need to use that technique. ___ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Re: Working! - Re: user crontab
Hi. On Fri, 08 May 2020 06:56:58 -0400 Robert Moskowitz wrote: > On 5/8/20 2:08 AM, Cameron Simpson wrote: >> You _do_ need to ensure the message at least ends with a newline, of >> the From_ won't be at the start of a line. So the previously posted >> script ensures that with the "echo" in "( cat; echo )". If you want to >> ensure a blank line you also need an additional "echo". > Working on it. Plus I have to sed in a Date: line. >> Or Robert could install an MDA and make it the MDA's problem :-) > What fun would that be? IMO none :-( > Plus I have always thought of this as a deficiency in cron on a > workstation. Cron should work (report in this case) properly without > needing something else (MTA) installed. There is an alternative to cron: systemd.timer See my previous post: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org/message/4WZ2QUP7XYV7AJDKL4QBMV7KBD4ALCMI/ In your case you will have to use the service manager of your account instead of the system one. In short, use "systemctl --user" "journalctl --user". Assuming you write a rsync-ietf.service file, you can then use: ## Status of this rsync: systemctl --user status rsync-ietf.service ## Logs since midnight: journalctl --user --since 00:00 -u rsync-ietf.service I can give more help if you want to use that. -- francis ___ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Re: Working! - Re: user crontab
On 5/8/20 2:24 AM, Gordon Messmer wrote: On 5/7/20 10:44 PM, Jon LaBadie wrote: In my mail files each message is followed by a blank line before the next "From_" line. Is that a requirement of mbox format? If so, it may be necessary to add it to the crontab output. Yes, it's a requirement of the format. That's why there's an "echo" after "cat". :) Oops. That is right. And I need to change this to do a sed to insert a Date: line in the right place... ___ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Re: Working! - Re: user crontab
On 5/8/20 2:08 AM, Cameron Simpson wrote: On 08May2020 01:44, Jon LaBadie wrote: On Fri, May 08, 2020 at 09:57:33AM +1000, Cameron Simpson wrote: On 07May2020 15:01, Robert Moskowitz wrote: > /ustr/sbin/mycron: > #!/bin/sh > > currentDate="$(date +'%a %b %d %T %Y')" > echo "From cron@localhost "$currentDate >> /var/spool/mail/$USER Put $currentDate inside the quotes. With echo it is less of an issue, but for many other commands you should exert more control over strings. So as a matter of practice: echo "From cron@localhost $currentDate" If nothing else it prevents filename expansion happening to the value of $currentDate. (Not that that will happen with the date format chosen, but again, as a general practice in scripting.) In my mail files each message is followed by a blank line before the next "From_" line. Is that a requirement of mbox format? If so, it may be necessary to add it to the crontab output. Kinda. Depends on the thing parsing the mbox file. To avoid misparsing message body lines which themselves commance with "From " some things only consider a From_ line after a blank line. Others rely on ">" stuffing. It is all a mess. You _do_ need to ensure the message at least ends with a newline, of the From_ won't be at the start of a line. So the previously posted script ensures that with the "echo" in "( cat; echo )". If you want to ensure a blank line you also need an additional "echo". Working on it. Plus I have to sed in a Date: line. Or Robert could install an MDA and make it the MDA's problem :-) What fun would that be? Plus I have always thought of this as a deficiency in cron on a workstation. Cron should work (report in this case) properly without needing something else (MTA) installed. Maybe the developers will pick this up and do it right... Cheers, Cameron Simpson ___ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org ___ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Re: user crontab
On 5/8/20 1:16 AM, Tim via users wrote: On Thu, 2020-05-07 at 09:09 -0500, Roger Heflin wrote: In general if you set up the cronjobs to redirect stdout and stderr to a file then typically there is nothing to email. Just thinking out loud: If your scripts generate their own logs, you see the results of your scripts. But if cron generates its logs, you see the results of cron executing your scripts. Might there be a difference beyond the obvious of knowing it was run by cron? I kind of have it working. There is a bit of valuable info in the headers from cron. I have to modify my script to add a Date: line, but: From cron@localhost Fri May 08 04:01:10 2020 From: "(Cron Daemon)" To: rgm Subject: Cron rsync -tvz rsync.tools.ietf.org::tools.id/*.txt /home /common/ietf/drafts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Auto-Submitted: auto-generated Precedence: bulk X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: Status: RO Content-Length: 1212 Lines: 32 1id-abstracts.txt skipping non-regular file "code.txt" 1id-index.txt all_id.txt all_id2.txt draft-bdc-something-something-certificate-04.txt draft-chen-top-level-interface-protocol-01.txt draft-iesg-nomcom-eligibility-2020-03.txt draft-ietf-cbor-date-tag-00.txt draft-ietf-ccamp-layer0-types-04.txt draft-ietf-i2nsf-nsf-facing-interface-dm-09.txt draft-ietf-i2nsf-nsf-monitoring-data-model-03.txt draft-ietf-idr-bgp-bfd-strict-mode-03.txt draft-ietf-lisp-predictive-rlocs-06.txt draft-ietf-lsvr-l3dl-04.txt draft-ietf-mpls-lsp-ping-ospfv3-codepoint-02.txt draft-ietf-opsawg-sdi-09.txt draft-ietf-roll-aodv-rpl-08.txt draft-ietf-spring-segment-routing-policy-07.txt draft-ietf-tsvwg-datagram-plpmtud-20.txt draft-irtf-icnrg-icn-lte-4g-06.txt draft-jeong-ipwave-context-aware-navigator-01.txt draft-jeong-ipwave-iot-dns-autoconf-08.txt draft-jeong-ipwave-security-privacy-01.txt draft-jeong-ipwave-vehicular-mobility-management-03.txt draft-jeong-ipwave-vehicular-neighbor-discovery-09.txt draft-yang-i2nsf-security-policy-translation-06.txt draft-zheng-ccamp-client-pm-yang-01.txt replaced_id.txt sent 36,590 bytes received 5,737,944 bytes 427,743.26 bytes/sec total size is 6,540,286,093 speedup is 1,132.61 ___ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Re: Working! - Re: user crontab
On Fri, 2020-05-08 at 01:44 -0400, Jon LaBadie wrote: > In my mail files each message is followed by a blank line > before the next "From_" line. Is that a requirement of > mbox format? If so, it may be necessary to add it to > the crontab output. It's how mbox works, each email is concatenated into one huge file, and that's the separator (a blank line, then a "from" line at the beginning of the next message). i.e. It's an mbox thing, not a general email thing. Of course, it's entirely possible for someone to write an email, starting off a new paragraph with the word from, and that'll confuse the heck of dumbly written email software. Typically, they'll split the email there, you'll only see what appeared before it, and the rest of the mail will be completely lost. I say dumb, because it's well known that people might write an email that way, they should't have to word their emails some other way, and email software should be able to handle it, one way or another. The usual way is that some mail handler will add a character into the text, somewhere, to make it different (e.g. shove a > in front, or add another character after the word from). That could be your own email program, munging the message as it sends it (another dumb thing), or it could be an email server munging messages as it passes through them knowing that *it* is going to store its messages in a mbox file (just acceptable), or some email server munging messages passing through it in case some other mail server can't handle it (another dumb thing). Another way of handling it is for your mail server to not use a from line, and be able to ignore the word "from" appearing in a message. Whether that be using some other non-standard message separation method of their own, or an addition (such as adding details to the "from line" about the length of the message, so the server doesn't break apart messages when the word "from" appears before the end of the message), or a different mail storage technique. e.g. Maildir stores each email as a separate file, so doesn't need to use that technique. -- uname -rsvp Linux 3.10.0-1127.el7.x86_64 #1 SMP Tue Mar 31 23:36:51 UTC 2020 x86_64 Boilerplate: All unexpected mail to my mailbox is automatically deleted. I will only get to see the messages that are posted to the mailing list. ___ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Re: Working! - Re: user crontab
On 5/7/20 10:44 PM, Jon LaBadie wrote: In my mail files each message is followed by a blank line before the next "From_" line. Is that a requirement of mbox format? If so, it may be necessary to add it to the crontab output. Yes, it's a requirement of the format. That's why there's an "echo" after "cat". :) ___ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Re: Working! - Re: user crontab
On 08May2020 01:44, Jon LaBadie wrote: On Fri, May 08, 2020 at 09:57:33AM +1000, Cameron Simpson wrote: On 07May2020 15:01, Robert Moskowitz wrote: > /ustr/sbin/mycron: > #!/bin/sh > > currentDate="$(date +'%a %b %d %T %Y')" > echo "From cron@localhost "$currentDate >> /var/spool/mail/$USER Put $currentDate inside the quotes. With echo it is less of an issue, but for many other commands you should exert more control over strings. So as a matter of practice: echo "From cron@localhost $currentDate" If nothing else it prevents filename expansion happening to the value of $currentDate. (Not that that will happen with the date format chosen, but again, as a general practice in scripting.) In my mail files each message is followed by a blank line before the next "From_" line. Is that a requirement of mbox format? If so, it may be necessary to add it to the crontab output. Kinda. Depends on the thing parsing the mbox file. To avoid misparsing message body lines which themselves commance with "From " some things only consider a From_ line after a blank line. Others rely on ">" stuffing. It is all a mess. You _do_ need to ensure the message at least ends with a newline, of the From_ won't be at the start of a line. So the previously posted script ensures that with the "echo" in "( cat; echo )". If you want to ensure a blank line you also need an additional "echo". Or Robert could install an MDA and make it the MDA's problem :-) Cheers, Cameron Simpson ___ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Re: Working! - Re: user crontab
On Fri, May 08, 2020 at 09:57:33AM +1000, Cameron Simpson wrote: > On 07May2020 15:01, Robert Moskowitz wrote: > > /ustr/sbin/mycron: > > #!/bin/sh > > > > currentDate="$(date +'%a %b %d %T %Y')" > > echo "From cron@localhost "$currentDate >> /var/spool/mail/$USER > > Put $currentDate inside the quotes. With echo it is less of an issue, but > for many other commands you should exert more control over strings. So as a > matter of practice: > >echo "From cron@localhost $currentDate" > > If nothing else it prevents filename expansion happening to the value of > $currentDate. (Not that that will happen with the date format chosen, but > again, as a general practice in scripting.) > In my mail files each message is followed by a blank line before the next "From_" line. Is that a requirement of mbox format? If so, it may be necessary to add it to the crontab output. Jon -- Jon H. LaBadie jo...@jgcomp.com ___ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Re: user crontab
On Thu, 2020-05-07 at 09:09 -0500, Roger Heflin wrote: > In general if you set up the cronjobs to redirect stdout and stderr > to a file then typically there is nothing to email. Just thinking out loud: If your scripts generate their own logs, you see the results of your scripts. But if cron generates its logs, you see the results of cron executing your scripts. Might there be a difference beyond the obvious of knowing it was run by cron? -- uname -rsvp Linux 3.10.0-1127.el7.x86_64 #1 SMP Tue Mar 31 23:36:51 UTC 2020 x86_64 Boilerplate: All unexpected mail to my mailbox is automatically deleted. I will only get to see the messages that are posted to the mailing list. ___ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Re: Working! - Re: user crontab
On 07May2020 15:01, Robert Moskowitz wrote: /ustr/sbin/mycron: #!/bin/sh currentDate="$(date +'%a %b %d %T %Y')" echo "From cron@localhost "$currentDate >> /var/spool/mail/$USER Put $currentDate inside the quotes. With echo it is less of an issue, but for many other commands you should exert more control over strings. So as a matter of practice: echo "From cron@localhost $currentDate" If nothing else it prevents filename expansion happening to the value of $currentDate. (Not that that will happen with the date format chosen, but again, as a general practice in scripting.) Also: [...] It SEEMs that what I am missing is a FROM: line at the beginning that mutt can handle. Perhaps something like: From cron@localhost Thu May 07 13:15:01 2020 Note no colon after 'From' and a timestamp Note that that is _not_ a "From:" line. A "From:" line is a message header line strating with "From:". Like the "To:" and "Subject:" etc in most message headers. What you're supplying is the "message envelope" delimiter line used in mbox files, which starts with "From ". It is often called a From_ line (note the trailing undescore) specificly to distinguish it in conversation from a message header line. It isn't part of the message, if it part of the mbox syntax delimiting messages. Cheers, Cameron Simpson ___ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Re: user crontab
On 07May2020 12:43, Joe Zeff wrote: On 05/07/2020 08:04 AM, Robert Moskowitz wrote: So all I need is a script at /usr/bin/mycron Actually, you can put it wherever you want, including ~/bin, as long as you give the complete path. /usr/bin may be the best place, but it's not the only place. Just a thought. I would use /usr/local/bin. /bin and /usr/bin are "owned" my the OS vendor (Fedora), and they might tread on your script in the future. /usr/local/bin is nicely out of the way, which still in the default $PATH. Cheers, Cameron Simpson ___ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Re: user crontab
On 07May2020 07:38, Robert Moskowitz wrote: On 5/6/20 11:06 PM, Gordon Messmer wrote: Technically, no. If you only want to deliver the messages locally, then you only need an MDA, not an MTA. In fact, you could just create /usr/sbin/sendmail as a simple shell script: #!/bin/sh (cat; echo) >> $HOME/cron-output Now I am getting some place. But I would want it to go to /var/spool/mail/$USER Also there is already a /usr/sbin/sendmail on the system. I am concerned that if I replace it with your example, a later update will remove it. Indeed. Find out what package owns it. "rpm -qf /usr/sbin/sendmail" used to be the go, not sure of the matching dnf or yum incantation. I looked at man crontab.5 and did not see a way to specify the mail command to run for the cron output. There isn't. It uses the "system mail", use _is_ /usr/sbin/sendmail. And finally, how could I test this after setting it up instead of waiting for the scheduled time? A 1 minute cron job? * * * * * echo hello Cheers, Cameron Simpson ___ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Re: user crontab
On 07May2020 09:25, Robert Moskowitz wrote: The bottom of that manual entry describes the "mta" setting, and says that esmtp relies on a local MTA for local delivery (addresses without an "@"). So you'll need something additional anyway. May as well go straight to a proper MTA. And then, to my chagrin, I reread and see it provides example "mta" values like: /usr/bin/procmail -d %T So you may be good there. Would first have to install procmail for this. Yes, or one of the other suggestions. You need a delivery agent of some kind. It would be interesting to find a 'simple' python script to grab the cron output and 'make' an email and appended to the spool/mail Someone has already posts a simple shell script for that purpose to this discussion. I am finding things about python and email that is leading me down many roads. First is how does CRON even send emails? The MAILTO option triggers where to send email, but what is the how? What is CRON using to grab its output and stuff that into what emailer program? Cron collects the command output and if not empty feeds it to "/usr/sbin/sendmail -oi "$MAILTO"". So your need to intercept that. installing an MTA installs a sendmail executable. Cheers, Cameron Simpson ___ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Re: Working! - Re: user crontab
/ustr/sbin/mycron: #!/bin/sh currentDate="$(date +'%a %b %d %T %Y')" echo "From cron@localhost "$currentDate >> /var/spool/mail/$USER (cat; echo) >> /var/spool/mail/$USER /etc/sysconfig/crond: # Settings for the CRON daemon. # CRONDARGS= : any extra command-line startup arguments for crond CRONDARGS= -m "/usr/sbin/mycron" And there you have your cron output going to the local mail store without a mailer. View with mutt or other mbox viewer. That date format is important... Whew. On 5/7/20 2:00 PM, Robert Moskowitz wrote: I have dug a bit into mbox fomat and looked at one system that has some mail in root's mbox. It SEEMs that what I am missing is a FROM: line at the beginning that mutt can handle. Perhaps something like: From cron@localhost Thu May 07 13:15:01 2020 Note no colon after 'From' and a timestamp How can I make a command to add to my script to create this? Meanwhile I keep digging. thanks On 5/7/20 1:24 PM, Robert Moskowitz wrote: First I made a script at /usr/sbin/mycron #!/bin/sh (cat; echo) >> /var/spool/mail/$USER Then I changed cat /etc/sysconfig/crond # Settings for the CRON daemon. # CRONDARGS= : any extra command-line startup arguments for crond CRONDARGS= -m "/usr/sbin/mycron" And restarted crond Next I changed my crontab with: 15 * * * * ls /home/rgm I know have mail waiting in /var/spool/mail/rgm, but mutt can't process it. So I am missing something in the format of mail in /var/spool/mail. Can someone point me to the proper format? What I have there from the cron of that ls is: From: "(Cron Daemon)" To: rgm Subject: Cron ls /home/rgm MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Auto-Submitted: auto-generated Precedence: bulk X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: arm bin data Desktop Documents Downloads Music odds Pictures Public r rcd Templates test tftpboot uasca Videos On 5/7/20 10:04 AM, Robert Moskowitz wrote: On 5/7/20 9:25 AM, Robert Moskowitz wrote: On 5/7/20 7:48 AM, Robert Moskowitz wrote: On 5/6/20 11:34 PM, Cameron Simpson wrote: On 07May2020 13:19, Cameron Simpson wrote: On 06May2020 20:20, Robert Moskowitz wrote: I am reading up on esmtp which comes with the base install and seemingly no mta needed? Anyway https://linux.die.net/man/5/esmtprc shows how to config for sending an email via esmtp to an mta, but not just local delivery... The bottom of that manual entry describes the "mta" setting, and says that esmtp relies on a local MTA for local delivery (addresses without an "@"). So you'll need something additional anyway. May as well go straight to a proper MTA. And then, to my chagrin, I reread and see it provides example "mta" values like: /usr/bin/procmail -d %T So you may be good there. Would first have to install procmail for this. It would be interesting to find a 'simple' python script to grab the cron output and 'make' an email and appended to the spool/mail I am finding things about python and email that is leading me down many roads. First is how does CRON even send emails? The MAILTO option triggers where to send email, but what is the how? What is CRON using to grab its output and stuff that into what emailer program? My digging is that CRON needs some email server installed, like postfix, before it will send emails of its stdout. But where is this controlled so I can change it? Ah, looking at man crond.5: -m This option allows you to specify a shell command to use for sending Cron mail output instead of using sendmail(8) This com‐ mand must accept a fully formatted mail message (with headers) on standard input and send it as a mail message to the recipi‐ ents specified in the mail headers. Specifying the string off (i.e., crond -m off) will disable the sending of mail. So all I need is a script at /usr/bin/mycron #!/bin/sh something something So what do I put in the -m arg and in mycron so that this output gets appended to /var/spool/mail/MAILTO ? Thanks ___ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org ___ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://list
Re: user crontab
On 05/07/2020 08:04 AM, Robert Moskowitz wrote: So all I need is a script at /usr/bin/mycron Actually, you can put it wherever you want, including ~/bin, as long as you give the complete path. /usr/bin may be the best place, but it's not the only place. Just a thought. ___ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Re: Almost working - Re: user crontab
I have dug a bit into mbox fomat and looked at one system that has some mail in root's mbox. It SEEMs that what I am missing is a FROM: line at the beginning that mutt can handle. Perhaps something like: From cron@localhost Thu May 07 13:15:01 2020 Note no colon after 'From' and a timestamp How can I make a command to add to my script to create this? Meanwhile I keep digging. thanks On 5/7/20 1:24 PM, Robert Moskowitz wrote: First I made a script at /usr/sbin/mycron #!/bin/sh (cat; echo) >> /var/spool/mail/$USER Then I changed cat /etc/sysconfig/crond # Settings for the CRON daemon. # CRONDARGS= : any extra command-line startup arguments for crond CRONDARGS= -m "/usr/sbin/mycron" And restarted crond Next I changed my crontab with: 15 * * * * ls /home/rgm I know have mail waiting in /var/spool/mail/rgm, but mutt can't process it. So I am missing something in the format of mail in /var/spool/mail. Can someone point me to the proper format? What I have there from the cron of that ls is: From: "(Cron Daemon)" To: rgm Subject: Cron ls /home/rgm MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Auto-Submitted: auto-generated Precedence: bulk X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: arm bin data Desktop Documents Downloads Music odds Pictures Public r rcd Templates test tftpboot uasca Videos On 5/7/20 10:04 AM, Robert Moskowitz wrote: On 5/7/20 9:25 AM, Robert Moskowitz wrote: On 5/7/20 7:48 AM, Robert Moskowitz wrote: On 5/6/20 11:34 PM, Cameron Simpson wrote: On 07May2020 13:19, Cameron Simpson wrote: On 06May2020 20:20, Robert Moskowitz wrote: I am reading up on esmtp which comes with the base install and seemingly no mta needed? Anyway https://linux.die.net/man/5/esmtprc shows how to config for sending an email via esmtp to an mta, but not just local delivery... The bottom of that manual entry describes the "mta" setting, and says that esmtp relies on a local MTA for local delivery (addresses without an "@"). So you'll need something additional anyway. May as well go straight to a proper MTA. And then, to my chagrin, I reread and see it provides example "mta" values like: /usr/bin/procmail -d %T So you may be good there. Would first have to install procmail for this. It would be interesting to find a 'simple' python script to grab the cron output and 'make' an email and appended to the spool/mail I am finding things about python and email that is leading me down many roads. First is how does CRON even send emails? The MAILTO option triggers where to send email, but what is the how? What is CRON using to grab its output and stuff that into what emailer program? My digging is that CRON needs some email server installed, like postfix, before it will send emails of its stdout. But where is this controlled so I can change it? Ah, looking at man crond.5: -m This option allows you to specify a shell command to use for sending Cron mail output instead of using sendmail(8) This com‐ mand must accept a fully formatted mail message (with headers) on standard input and send it as a mail message to the recipi‐ ents specified in the mail headers. Specifying the string off (i.e., crond -m off) will disable the sending of mail. So all I need is a script at /usr/bin/mycron #!/bin/sh something something So what do I put in the -m arg and in mycron so that this output gets appended to /var/spool/mail/MAILTO ? Thanks ___ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org ___ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Re: user crontab
On 5/7/20 1:24 PM, Alexander Dalloz wrote: Am 07.05.2020 um 02:11 schrieb Robert Moskowitz: Cameron, Oh I have done a lot with postfix: http://www.htt-consult.com/Centos7-mailserver.html Showing a broken / incomplete submission and submissions setup in master.cf of Postfix. Notice it says work-in-progress. Any tips gladly accepted. I have not worked on this in a year, and I REALLY need to get back to it and get it working. The obvious problems are with the amavis and following parts. But it is a good step forward from so many guides that have, "replace your main.cf with this!". ___ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Re: user crontab
Am 07.05.2020 um 02:11 schrieb Robert Moskowitz: Cameron, Oh I have done a lot with postfix: http://www.htt-consult.com/Centos7-mailserver.html Showing a broken / incomplete submission and submissions setup in master.cf of Postfix. Alexander ___ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Almost working - Re: user crontab
First I made a script at /usr/sbin/mycron #!/bin/sh (cat; echo) >> /var/spool/mail/$USER Then I changed cat /etc/sysconfig/crond # Settings for the CRON daemon. # CRONDARGS= : any extra command-line startup arguments for crond CRONDARGS= -m "/usr/sbin/mycron" And restarted crond Next I changed my crontab with: 15 * * * * ls /home/rgm I know have mail waiting in /var/spool/mail/rgm, but mutt can't process it. So I am missing something in the format of mail in /var/spool/mail. Can someone point me to the proper format? What I have there from the cron of that ls is: From: "(Cron Daemon)" To: rgm Subject: Cron ls /home/rgm MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Auto-Submitted: auto-generated Precedence: bulk X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: arm bin data Desktop Documents Downloads Music odds Pictures Public r rcd Templates test tftpboot uasca Videos On 5/7/20 10:04 AM, Robert Moskowitz wrote: On 5/7/20 9:25 AM, Robert Moskowitz wrote: On 5/7/20 7:48 AM, Robert Moskowitz wrote: On 5/6/20 11:34 PM, Cameron Simpson wrote: On 07May2020 13:19, Cameron Simpson wrote: On 06May2020 20:20, Robert Moskowitz wrote: I am reading up on esmtp which comes with the base install and seemingly no mta needed? Anyway https://linux.die.net/man/5/esmtprc shows how to config for sending an email via esmtp to an mta, but not just local delivery... The bottom of that manual entry describes the "mta" setting, and says that esmtp relies on a local MTA for local delivery (addresses without an "@"). So you'll need something additional anyway. May as well go straight to a proper MTA. And then, to my chagrin, I reread and see it provides example "mta" values like: /usr/bin/procmail -d %T So you may be good there. Would first have to install procmail for this. It would be interesting to find a 'simple' python script to grab the cron output and 'make' an email and appended to the spool/mail I am finding things about python and email that is leading me down many roads. First is how does CRON even send emails? The MAILTO option triggers where to send email, but what is the how? What is CRON using to grab its output and stuff that into what emailer program? My digging is that CRON needs some email server installed, like postfix, before it will send emails of its stdout. But where is this controlled so I can change it? Ah, looking at man crond.5: -m This option allows you to specify a shell command to use for sending Cron mail output instead of using sendmail(8) This com‐ mand must accept a fully formatted mail message (with headers) on standard input and send it as a mail message to the recipi‐ ents specified in the mail headers. Specifying the string off (i.e., crond -m off) will disable the sending of mail. So all I need is a script at /usr/bin/mycron #!/bin/sh something something So what do I put in the -m arg and in mycron so that this output gets appended to /var/spool/mail/MAILTO ? Thanks ___ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Re: user crontab
In general if you set up the cronjobs to redirect stdout and stderr to a file then typically there is nothing to email. Often if you have only a few systems this is easier to use. On Thu, May 7, 2020 at 8:29 AM Robert Moskowitz wrote: > > > > On 5/7/20 7:48 AM, Robert Moskowitz wrote: > > > > > > On 5/6/20 11:34 PM, Cameron Simpson wrote: > >> On 07May2020 13:19, Cameron Simpson wrote: > >>> On 06May2020 20:20, Robert Moskowitz wrote: > I am reading up on esmtp which comes with the base install and > seemingly no mta needed? > > Anyway > https://linux.die.net/man/5/esmtprc > > shows how to config for sending an email via esmtp to an mta, but > not just local delivery... > >>> > >>> The bottom of that manual entry describes the "mta" setting, and > >>> says that esmtp relies on a local MTA for local delivery (addresses > >>> without an "@"). So you'll need something additional anyway. May as > >>> well go straight to a proper MTA. > >> > >> And then, to my chagrin, I reread and see it provides example "mta" > >> values like: > >> > >>/usr/bin/procmail -d %T > >> > >> So you may be good there. > > > > Would first have to install procmail for this. > > > > It would be interesting to find a 'simple' python script to grab the > > cron output and 'make' an email and appended to the spool/mail > > I am finding things about python and email that is leading me down many > roads. > > First is how does CRON even send emails? The MAILTO option triggers > where to send email, but what is the how? What is CRON using to grab > its output and stuff that into what emailer program? > > My digging is that CRON needs some email server installed, like postfix, > before it will send emails of its stdout. But where is this controlled > so I can change it? > > thanks > ___ > users mailing list -- users@lists.fedoraproject.org > To unsubscribe send an email to users-le...@lists.fedoraproject.org > Fedora Code of Conduct: > https://docs.fedoraproject.org/en-US/project/code-of-conduct/ > List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines > List Archives: > https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org ___ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Re: user crontab
On 5/7/20 9:25 AM, Robert Moskowitz wrote: On 5/7/20 7:48 AM, Robert Moskowitz wrote: On 5/6/20 11:34 PM, Cameron Simpson wrote: On 07May2020 13:19, Cameron Simpson wrote: On 06May2020 20:20, Robert Moskowitz wrote: I am reading up on esmtp which comes with the base install and seemingly no mta needed? Anyway https://linux.die.net/man/5/esmtprc shows how to config for sending an email via esmtp to an mta, but not just local delivery... The bottom of that manual entry describes the "mta" setting, and says that esmtp relies on a local MTA for local delivery (addresses without an "@"). So you'll need something additional anyway. May as well go straight to a proper MTA. And then, to my chagrin, I reread and see it provides example "mta" values like: /usr/bin/procmail -d %T So you may be good there. Would first have to install procmail for this. It would be interesting to find a 'simple' python script to grab the cron output and 'make' an email and appended to the spool/mail I am finding things about python and email that is leading me down many roads. First is how does CRON even send emails? The MAILTO option triggers where to send email, but what is the how? What is CRON using to grab its output and stuff that into what emailer program? My digging is that CRON needs some email server installed, like postfix, before it will send emails of its stdout. But where is this controlled so I can change it? Ah, looking at man crond.5: -m This option allows you to specify a shell command to use for sending Cron mail output instead of using sendmail(8) This com‐ mand must accept a fully formatted mail message (with headers) on standard input and send it as a mail message to the recipi‐ ents specified in the mail headers. Specifying the string off (i.e., crond -m off) will disable the sending of mail. So all I need is a script at /usr/bin/mycron #!/bin/sh something something So what do I put in the -m arg and in mycron so that this output gets appended to /var/spool/mail/MAILTO ? Thanks ___ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Re: user crontab
On 5/7/20 7:48 AM, Robert Moskowitz wrote: On 5/6/20 11:34 PM, Cameron Simpson wrote: On 07May2020 13:19, Cameron Simpson wrote: On 06May2020 20:20, Robert Moskowitz wrote: I am reading up on esmtp which comes with the base install and seemingly no mta needed? Anyway https://linux.die.net/man/5/esmtprc shows how to config for sending an email via esmtp to an mta, but not just local delivery... The bottom of that manual entry describes the "mta" setting, and says that esmtp relies on a local MTA for local delivery (addresses without an "@"). So you'll need something additional anyway. May as well go straight to a proper MTA. And then, to my chagrin, I reread and see it provides example "mta" values like: /usr/bin/procmail -d %T So you may be good there. Would first have to install procmail for this. It would be interesting to find a 'simple' python script to grab the cron output and 'make' an email and appended to the spool/mail I am finding things about python and email that is leading me down many roads. First is how does CRON even send emails? The MAILTO option triggers where to send email, but what is the how? What is CRON using to grab its output and stuff that into what emailer program? My digging is that CRON needs some email server installed, like postfix, before it will send emails of its stdout. But where is this controlled so I can change it? thanks ___ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Re: user crontab
On Thu, 7 May 2020 at 08:49, Robert Moskowitz wrote: > > > On 5/6/20 11:34 PM, Cameron Simpson wrote: > > On 07May2020 13:19, Cameron Simpson wrote: > >> On 06May2020 20:20, Robert Moskowitz wrote: > >>> I am reading up on esmtp which comes with the base install and > >>> seemingly no mta needed? > >>> > >>> Anyway > >>> https://linux.die.net/man/5/esmtprc > >>> > >>> shows how to config for sending an email via esmtp to an mta, but > >>> not just local delivery... > >> > >> The bottom of that manual entry describes the "mta" setting, and says > >> that esmtp relies on a local MTA for local delivery (addresses > >> without an "@"). So you'll need something additional anyway. May as > >> well go straight to a proper MTA. > > > > And then, to my chagrin, I reread and see it provides example "mta" > > values like: > > > >/usr/bin/procmail -d %T > > > > So you may be good there. > > Would first have to install procmail for this. > > It would be interesting to find a 'simple' python script to grab the > cron output and 'make' an email and appended to the spool/mail > > Mail is one of the areas where userd will add complexity. Having worked in a large enterprise where mail leaving the intranet was tightly controlled, my use of mail was limited to use cases like cron, at, and ad-hoc status reports from our internal processing systems. It may be time to revisit the use of mail for these use cases. Mail is often inconvenient for data analysis like % of jobs that failed, reasons for failures (out of disk or memory space, program crashed, network down, etc.) and trends in the time stats for jobs, There are much fancier job scheduling systems that check for resources before starting jobs, have a dashboard where you can see the status of jobs (status of finished tasks, stats of running tasks, job queue with details to explain why a particular job was delayed, etc.). One annoyance with mail being locked down is that uses often miss notifications of problems. When I retired, linux uses were moving to NUMA workstations where there are issues around assigning cores to jobs to make best used of cache and avoid long IPC hops, scheduling of GPU dependent jobs, etc. With cron, some tasks need to pay attention to resource issues, so you end up with a lot of ad-hoc hacks (kinda like the situation with init scripts). SLURM is claimed to be suitable for NUMA workstations up to the largest supercomuters. I have never used it myself, but it is available in Fedora. -- George N. White III ___ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Re: user crontab
On 5/6/20 11:34 PM, Cameron Simpson wrote: On 07May2020 13:19, Cameron Simpson wrote: On 06May2020 20:20, Robert Moskowitz wrote: I am reading up on esmtp which comes with the base install and seemingly no mta needed? Anyway https://linux.die.net/man/5/esmtprc shows how to config for sending an email via esmtp to an mta, but not just local delivery... The bottom of that manual entry describes the "mta" setting, and says that esmtp relies on a local MTA for local delivery (addresses without an "@"). So you'll need something additional anyway. May as well go straight to a proper MTA. And then, to my chagrin, I reread and see it provides example "mta" values like: /usr/bin/procmail -d %T So you may be good there. Would first have to install procmail for this. It would be interesting to find a 'simple' python script to grab the cron output and 'make' an email and appended to the spool/mail ___ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Re: user crontab
On 5/6/20 11:06 PM, Gordon Messmer wrote: On 5/6/20 3:00 PM, Robert Moskowitz wrote: Do I need something like postfix with a minimal installation to get the output from my crontab? Technically, no. If you only want to deliver the messages locally, then you only need an MDA, not an MTA. In fact, you could just create /usr/sbin/sendmail as a simple shell script: #!/bin/sh (cat; echo) >> $HOME/cron-output Now I am getting some place. But I would want it to go to /var/spool/mail/$USER Also there is already a /usr/sbin/sendmail on the system. I am concerned that if I replace it with your example, a later update will remove it. I looked at man crontab.5 and did not see a way to specify the mail command to run for the cron output. And finally, how could I test this after setting it up instead of waiting for the scheduled time? thanks ___ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Re: user crontab
On 07May2020 13:19, Cameron Simpson wrote: On 06May2020 20:20, Robert Moskowitz wrote: I am reading up on esmtp which comes with the base install and seemingly no mta needed? Anyway https://linux.die.net/man/5/esmtprc shows how to config for sending an email via esmtp to an mta, but not just local delivery... The bottom of that manual entry describes the "mta" setting, and says that esmtp relies on a local MTA for local delivery (addresses without an "@"). So you'll need something additional anyway. May as well go straight to a proper MTA. And then, to my chagrin, I reread and see it provides example "mta" values like: /usr/bin/procmail -d %T So you may be good there. Cheers, Cameron Simpson ___ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Re: user crontab
On 06May2020 20:20, Robert Moskowitz wrote: I am reading up on esmtp which comes with the base install and seemingly no mta needed? Anyway https://linux.die.net/man/5/esmtprc shows how to config for sending an email via esmtp to an mta, but not just local delivery... The bottom of that manual entry describes the "mta" setting, and says that esmtp relies on a local MTA for local delivery (addresses without an "@"). So you'll need something additional anyway. May as well go straight to a proper MTA. Had you considered a shell script? cron and most local commands should be using "sendmail -oi addresses... < message" to deliver. A shell script to accept those commands and copy the input to an mbox or Maildir file would be pretty simple... Um, it doesn't solve delivering email to a different (local) user. I'm sure I've seen a minimal local MTA somewhere, can't remember. Actually, I think it might have been an esmtp equivalent for purely remote-via-SMTP email. The inverse of what you want. Cheers, Cameron Simpson ___ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Re: user crontab
On 5/6/20 3:00 PM, Robert Moskowitz wrote: Do I need something like postfix with a minimal installation to get the output from my crontab? Technically, no. If you only want to deliver the messages locally, then you only need an MDA, not an MTA. In fact, you could just create /usr/sbin/sendmail as a simple shell script: #!/bin/sh (cat; echo) >> $HOME/cron-output ___ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Re: user crontab
On 06May2020 20:11, Robert Moskowitz wrote: Oh I have done a lot with postfix: http://www.htt-consult.com/Centos7-mailserver.html Excellent. On 5/6/20 7:28 PM, Cameron Simpson wrote: With postfix, I put the following settings at the top of /etc/postfix/main.cf: better to use the postconf -e command had have the commands put in the proper places. Or append to the end, as postfix reads main.cf in order and last command wins. I can see that would avoid accidental replication (and loss of my custom setting). But personally I like to have the customisations at the top where I find them easy to see. Point taken though, postconf -e is more robust. So I can do postfix, and if I have a problem I will ask, If your experience is as deep as you say your expertise probably exceeds mine. but I wanted just a local mail delivery like maybe esmtp. Then I'm probably not helpful. I like a full mail system because I want to locally queue. (Eg respond to email while offline, have it go out later.) Cheers, Cameron Simpson ___ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Re: user crontab
On 5/6/20 7:28 PM, Cameron Simpson wrote: On 06May2020 18:15, Robert Moskowitz wrote: On 5/6/20 6:08 PM, ToddAndMargo via users wrote: MAILTO=rgm [...] Can you point me to some guide for this? Local delivery for viewing with mutt is ok. I don't have to send it to my mail server sendmail would take me running postfix locally. Or would sendmail work for local store delivery? Hmm. I run postfix locally on my laptops. And I read mail with mutt. I am reading up on esmtp which comes with the base install and seemingly no mta needed? Anyway https://linux.die.net/man/5/esmtprc shows how to config for sending an email via esmtp to an mta, but not just local delivery... ___ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Re: user crontab
Cameron, Oh I have done a lot with postfix: http://www.htt-consult.com/Centos7-mailserver.html On 5/6/20 7:28 PM, Cameron Simpson wrote: On 06May2020 18:15, Robert Moskowitz wrote: On 5/6/20 6:08 PM, ToddAndMargo via users wrote: MAILTO=rgm [...] Can you point me to some guide for this? Local delivery for viewing with mutt is ok. I don't have to send it to my mail server sendmail would take me running postfix locally. Or would sendmail work for local store delivery? Hmm. I run postfix locally on my laptops. And I read mail with mutt. Installing postfix is easy, _and_ being a proper mail system it also lets your queue and send. All the MAILTO= in crontab relies on is a "sendmail" executable, and all UNIX mail systems provide one. So installing postfix gets you one. (So does installing exim or sendmail or qmail etc, but I like postfix's configuration.) With postfix, I put the following settings at the top of /etc/postfix/main.cf: better to use the postconf -e command had have the commands put in the proper places. Or append to the end, as postfix reads main.cf in order and last command wins. I go way back years on the postfix list on things like this. # where to send email for off-this-host - I run something special, # but your ISP's mail service or the like should do just fine relayhost = 127.0.0.2:1025 # what domain email from this machine has - I run my own domain mydomain = cskk.id.au myorigin = cskk.id.au # what domains get delivered locally mydestination = $mydomain, $myhostname, localhost.$mydomain, localhost # postfix will accept SMTP - my laptop only listens on localhost inet_interfaces = localhost # don't relay for anyone else, just the laptop mynetworks_style = host mynetworks = 127.0.0.0/8, [::1]/128 # support the very cool "basic-address+suffix@" stuff recipient_delimiter = + # my usual upstream SMTP service gets stupid if you try to be too # enthusiastic default_destination_concurrency_limit = 1 The supplied main.cf has almost all the interesting settings set out already, with comments. Those I change I comment out in the main file and put the changed setting at the top of the file. Happy to help debug your setup. So I can do postfix, and if I have a problem I will ask, but I wanted just a local mail delivery like maybe esmtp. ___ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Re: user crontab
On 06May2020 18:15, Robert Moskowitz wrote: On 5/6/20 6:08 PM, ToddAndMargo via users wrote: MAILTO=rgm [...] Can you point me to some guide for this? Local delivery for viewing with mutt is ok. I don't have to send it to my mail server sendmail would take me running postfix locally. Or would sendmail work for local store delivery? Hmm. I run postfix locally on my laptops. And I read mail with mutt. Installing postfix is easy, _and_ being a proper mail system it also lets your queue and send. All the MAILTO= in crontab relies on is a "sendmail" executable, and all UNIX mail systems provide one. So installing postfix gets you one. (So does installing exim or sendmail or qmail etc, but I like postfix's configuration.) With postfix, I put the following settings at the top of /etc/postfix/main.cf: # where to send email for off-this-host - I run something special, # but your ISP's mail service or the like should do just fine relayhost = 127.0.0.2:1025 # what domain email from this machine has - I run my own domain mydomain = cskk.id.au myorigin = cskk.id.au # what domains get delivered locally mydestination = $mydomain, $myhostname, localhost.$mydomain, localhost # postfix will accept SMTP - my laptop only listens on localhost inet_interfaces = localhost # don't relay for anyone else, just the laptop mynetworks_style = host mynetworks = 127.0.0.0/8, [::1]/128 # support the very cool "basic-address+suffix@" stuff recipient_delimiter = + # my usual upstream SMTP service gets stupid if you try to be too # enthusiastic default_destination_concurrency_limit = 1 The supplied main.cf has almost all the interesting settings set out already, with comments. Those I change I comment out in the main file and put the changed setting at the top of the file. Happy to help debug your setup. Cheers, Cameron Simpson ___ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Re: user crontab
On 5/6/20 3:15 PM, Robert Moskowitz wrote: Can you point me to some guide for this? Local delivery for viewing with mutt is ok. I don't have to send it to my mail server sendmail would take me running postfix locally. Or would sendmail work for local store delivery? Hmm. You need some program that can handle local delivery. It appears exim4 is a fairly minimal one that should work by default. Or if you want really minimal, I found https://git.lekensteyn.nl/femtomail/ . ___ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Re: user crontab
On 2020-05-06 15:15, Robert Moskowitz wrote: On 5/6/20 6:08 PM, ToddAndMargo via users wrote: On 2020-05-06 15:00, Robert Moskowitz wrote: I know I can edit the user crontab with: crontab -e and display it with crontab -l But where is it? I don't see anything like ~/.crontab Hi Robert, Your crontab files are in # ls /var/spool/cron root tom dick harry The user's crontab will appear as the users name Ah, thanks. MAILTO=rgm Only set a variable. You have to use a program to send your mail. Good luck finding one that supports OAuth2. Check out curl and s-nail to send eMail. Can you point me to some guide for this? Local delivery for viewing with mutt is ok. I don't have to send it to my mail server sendmail would take me running postfix locally. Or would sendmail work for local store delivery? Hmm. man curl But good luck with that. Here is an example I have kicking around: $ cat mail.txt | curl -vvv smtps://smtp.zoho.com:465 --mail-from "x...@zoho.com" --mail-rcpt "y...@zoho.com" --ssl -u x...@zoho.com:xx -k --anyauth ___ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Re: user crontab
On 5/6/20 6:08 PM, ToddAndMargo via users wrote: On 2020-05-06 15:00, Robert Moskowitz wrote: I know I can edit the user crontab with: crontab -e and display it with crontab -l But where is it? I don't see anything like ~/.crontab Hi Robert, Your crontab files are in # ls /var/spool/cron root tom dick harry The user's crontab will appear as the users name Ah, thanks. MAILTO=rgm Only set a variable. You have to use a program to send your mail. Good luck finding one that supports OAuth2. Check out curl and s-nail to send eMail. Can you point me to some guide for this? Local delivery for viewing with mutt is ok. I don't have to send it to my mail server sendmail would take me running postfix locally. Or would sendmail work for local store delivery? Hmm. ___ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Re: user crontab
On Wed, 6 May 2020 18:00:45 -0400 Robert Moskowitz wrote: > But where is it? /var/spool/cron/user-name > Do I need something like postfix with a minimal installation to get the > output from my crontab? You need some kind of mail software, postfix might be overkill (but is certainly easier to configure than sendmail). Not sure if there is any mail software shipped by default on the live images any longer. ___ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Re: user crontab
On 2020-05-06 15:00, Robert Moskowitz wrote: I know I can edit the user crontab with: crontab -e and display it with crontab -l But where is it? I don't see anything like ~/.crontab Hi Robert, Your crontab files are in # ls /var/spool/cron root tom dick harry The user's crontab will appear as the users name MAILTO=rgm Only set a variable. You have to use a program to send your mail. Good luck finding one that supports OAuth2. Check out curl and s-nail to send eMail. -T ___ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
user crontab
I know I can edit the user crontab with: crontab -e and display it with crontab -l But where is it? I don't see anything like ~/.crontab Secondly, and more importantly, is getting a email from the user crontab. I have in my crontab: SHELL=/bin/bash PATH=/sbin:/bin:/usr/sbin:/usr/bin MAILTO=rgm And nothing gets mailed to /var/spool/mail/rgm ls /var/spool/mail/ -ls total 0 0 -rw-rw. 1 rgm mail 0 May 5 17:21 rgm 0 -rw-rw. 1 rpc mail 0 May 5 17:07 rpc Do I need something like postfix with a minimal installation to get the output from my crontab? thanks ___ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org