Re: Working! - Re: user crontab

2020-05-10 Thread Robert Moskowitz
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    $ ec

Re: Working! - Re: user crontab

2020-05-10 Thread Cameron Simpson
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

Re: Working! - Re: user crontab

2020-05-10 Thread Robert Moskowitz
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

Re: Working! - Re: user crontab

2020-05-09 Thread Samuel Sieb
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

Re: Working! - Re: user crontab

2020-05-08 Thread Cameron Simpson
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

Re: Working! - Re: user crontab

2020-05-08 Thread Samuel Sieb
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

Re: Working! - Re: user crontab

2020-05-08 Thread Cameron Simpson
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 white

Re: Working! - Re: user crontab

2020-05-08 Thread Cameron Simpson
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

Re: Working! - Re: user crontab

2020-05-08 Thread Cameron Simpson
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

Re: Working! - Re: user crontab

2020-05-08 Thread Samuel Sieb
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 i

Re: Working! - Re: user crontab

2020-05-08 Thread Robert Moskowitz
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 works

Re: Working! - Re: user crontab

2020-05-08 Thread Robert Moskowitz
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 thi

Re: Working! - Re: user crontab

2020-05-08 Thread Samuel Sieb
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

Re: Working! - Re: user crontab

2020-05-08 Thread Mike Wright
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 somethin

Re: Working! - Re: user crontab

2020-05-08 Thread Robert Moskowitz
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? Th

Re: Working! - Re: user crontab

2020-05-08 Thread Tim via users
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 ot

Re: Working! - Re: user crontab

2020-05-08 Thread Robert Moskowitz
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 necess

Re: Working! - Re: user crontab

2020-05-08 Thread Jon LaBadie
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 cronta

Re: Working! - Re: user crontab

2020-05-08 Thread Robert Moskowitz
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 mb

Re: Working! - Re: user crontab

2020-05-08 Thread Francis . Montagnac
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 "(

Re: Working! - Re: user crontab

2020-05-08 Thread Robert Moskowitz
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

Re: Working! - Re: user crontab

2020-05-08 Thread Robert Moskowitz
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@localh

Re: Working! - Re: user crontab

2020-05-08 Thread Tim via users
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

Re: Working! - Re: user crontab

2020-05-07 Thread Gordon Messmer
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

Re: Working! - Re: user crontab

2020-05-07 Thread Cameron Simpson
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

Re: Working! - Re: user crontab

2020-05-07 Thread Jon LaBadie
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 th

Re: Working! - Re: user crontab

2020-05-07 Thread Cameron Simpson
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 exer

Re: Working! - Re: user crontab

2020-05-07 Thread Robert Moskowitz
/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 C

Re: Almost working - Re: user crontab

2020-05-07 Thread Robert Moskowitz
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 timestam

Almost working - Re: user crontab

2020-05-07 Thread Robert Moskowitz
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 cha