Hi Michael,

Looking at the /etc/init.d/crond init script, here [1]

If the line "crond" was changed to "crond -L /var/log/crond.log" it would 
disable syslog and use that file ... but may need rotating if it gets large.

If the line "crond" was changed to "crond -L /dev/null" it would disable syslog 
and disable logging (ie. to /dev/null).

BTW, I manually tested both cases to be certain.

Lonnie

[1] 
https://github.com/astlinux-project/astlinux/blob/09e87eff8bca82bf4afab8dbe09560737dd80d5c/project/astlinux/target_skeleton/etc/init.d/crond#L38



> On Sep 27, 2023, at 8:01 PM, Michael Knill 
> <michael.kn...@ipcsolutions.com.au> wrote:
> 
> Hi group
>  
> Replying to this email again. I do understand below but just wondering if 
> there is any way to turn off Cron logging totally or send to a separate log 
> file?
>  
> Regards
> Michael Knill
>  
>  
> From: Lonnie Abelbeck <li...@lonnie.abelbeck.com>
> Date: Friday, 31 March 2023 at 1:01 am
> To: AstLinux Users Mailing List <astlinux-users@lists.sourceforge.net>
> Subject: Re: [Astlinux-users] Stopping logging of Crontab
> 
> Hi Michael,
> 
> The (busybox) crond daemon has a syslog level setting which defaults to 8, 
> the least verbose log level.  So no help there.
> 
> Using the filter for the Status Tab, is a reasonable idea.
> 
> 
> Personally, when executing shell commands on a regular interval of 
> seconds/minutes, I prefer to use a bash shell script and the sleep builtin. 
> (Using the sleep builtin keeps from spawning a new process whenever 'sleep' 
> is called).
> 
> The simplest example of this is the 'msmtpqueue' bash script [1]
> 
> Basic code setup and loop:
> --
> #!/bin/bash
> 
> LOCKFILE="/var/lock/foobar.lock"
> 
> # Robust 'bash' method of creating/testing for a lockfile
> if ! ( set -o noclobber; echo "$$" > "$LOCKFILE" ) 2>/dev/null; then
>   echo "foobar: already running, lockfile \"$LOCKFILE\" exists, process id: 
> $(cat "$LOCKFILE")."
>   return 9
> fi
> 
> # Load 'sleep' builtin if it exists
> if [ -f /usr/lib/bash/sleep ]; then
>   enable -f /usr/lib/bash/sleep sleep
> fi
> 
> #seconds to wait
> wait=300
> 
> trap 'rm -f "$LOCKFILE"; exit $?' INT TERM EXIT
> 
> while true; do
>   # do stuff
> 
>   sleep $wait
> done
> 
> rm -f "$LOCKFILE"
> trap - INT TERM EXIT
> --
> 
> Look at the actual code [1] for finer details.  Another fairly simple 
> example, asterisk-sip-monitor [2] which adds a PID file that can be removed 
> to exit the script.
> 
> Lonnie
> 
> [1] 
> https://github.com/astlinux-project/astlinux/blob/master/package/msmtp/msmtpqueue.sh
> 
> [2] 
> https://github.com/astlinux-project/astlinux/blob/master/package/asterisk/asterisk-sip-monitor
> 
> 
> 
> 
> 
> > On Mar 29, 2023, at 11:39 PM, Michael Knill 
> > <michael.kn...@ipcsolutions.com.au> wrote:
> > 
> > Short of putting in a filter for the Status Tab, is there any way to stop 
> > Crontab logging to Syslog.
> > I now have a process that is run every 10 minutes and its annoying that it 
> > logs to Syslog each time.
> >  
> > Regards
> >  
> > Michael Knill
> > Managing Director
> >  
> > D: +61 2 6189 1360
> > P: +61 2 6140 4656
> > E: michael.kn...@ipcsolutions.com.au
> > W: ipcsolutions.com.au
> > 
> 
> 
> 
> _______________________________________________
> Astlinux-users mailing list
> Astlinux-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/astlinux-users
> 
> Donations to support AstLinux are graciously accepted via PayPal to 
> pay...@krisk.org.
> _______________________________________________
> Astlinux-users mailing list
> Astlinux-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/astlinux-users
> 
> Donations to support AstLinux are graciously accepted via PayPal to 
> pay...@krisk.org.



_______________________________________________
Astlinux-users mailing list
Astlinux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/astlinux-users

Donations to support AstLinux are graciously accepted via PayPal to 
pay...@krisk.org.

Reply via email to