Re: user crontab

2020-05-11 Thread Ed Greshko
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 >>

Re: user crontab

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

Re: user crontab

2020-05-11 Thread Ed Greshko
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

Re: user crontab

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

Re: user crontab

2020-05-10 Thread Ed Greshko
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 t

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    $

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

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

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

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.

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

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

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

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

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

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

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?

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

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

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

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

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

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

Re: user crontab

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

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-08 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

Re: Working! - Re: user crontab

2020-05-08 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

Re: user crontab

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

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

Re: user crontab

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

Re: user crontab

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

Re: user crontab

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

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

Re: user crontab

2020-05-07 Thread Joe Zeff
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.

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

Re: user crontab

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

Re: user crontab

2020-05-07 Thread Alexander Dalloz
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

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

Re: user crontab

2020-05-07 Thread Roger Heflin
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: > > > > >

Re: user crontab

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

Re: user crontab

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

Re: user crontab

2020-05-07 Thread George N. White III
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

Re: user crontab

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

Re: user crontab

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

Re: user crontab

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

Re: user crontab

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

Re: user crontab

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

Re: user crontab

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

Re: user crontab

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

Re: user crontab

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

Re: user crontab

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

Re: user crontab

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

Re: user crontab

2020-05-06 Thread ToddAndMargo via users
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

Re: user crontab

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

Re: user crontab

2020-05-06 Thread Tom Horsley
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

Re: user crontab

2020-05-06 Thread ToddAndMargo via users
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

user crontab

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