NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/58408: cron ignores parameter "-n" in crontab



>Number:         58408
>Category:       bin
>Synopsis:       cron ignores parameter "-n" in crontab
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jul 09 07:35:00 +0000 2024
>Originator:     Dr. Nicola Mingotti
>Release:        10.0
>Organization:
Borghi SRL
>Environment:
NetBSD pulce4 10.0 NetBSD 10.0 (GENERIC) #0: Thu Mar 28 08:33:33 UTC 2024  mkrepro%mkrepro.NetBSD.org@localhost:/usr/src/sys/arch/evbarm/compile/GENERIC evbarm

>Description:
According to man page crontab (5), if the modifier '-n' is used before a command no mail should be sent on successful run. This is not the case, parameter '-n' is ignored. Example below. 




>How-To-Repeat:

---- /home/p/bin/test3.sh ----------
#!/bin/sh
echo "test3.sh -- `date` " >> /home/p/bin/test.log
echo "write something and quit. "
exit 0
------------------------------------

---- /home/p/bin/test4.sh ----------
#!/bin/sh
echo "test4.sh -- `date` " >> /home/p/bin/test.log
echo "write something and fail"
exit 1
------------------------------------

p@pulce4 $> crontab -l 
-----------
#
#minute hour    mday    month   wday    command
*/1     *       *       *       *        -n /home/p/bin/test3.sh
*/1     *       *       *       *        -n /home/p/bin/test4.sh
-----------

. wait a bit
p@pulce4> mail 
----
 N 14 root@pulce4.localdom  Tue Jul  9 08:55   3/695   "Cron <p@pulce4> /home/p/bin/test3.sh"
 N 15 root@pulce4.localdom  Tue Jul  9 08:56   3/693   "Cron <p@pulce4> /home/p/bin/test4.sh"
 N 16 root@pulce4.localdom  Tue Jul  9 08:56   3/695   "Cron <p@pulce4> /home/p/bin/test3.sh"
 N 17 root@pulce4.localdom  Tue Jul  9 08:57   3/693   "Cron <p@pulce4> /home/p/bin/test4.sh"
 N 18 root@pulce4.localdom  Tue Jul  9 08:57   3/695   "Cron <p@pulce4> /home/p/bin/test3.sh"
 N 19 root@pulce4.localdom  Tue Jul  9 08:58   3/693   "Cron <p@pulce4> /home/p/bin/test4.sh"
 N 20 root@pulce4.localdom  Tue Jul  9 08:58   3/695   "Cron <p@pulce4> /home/p/bin/test3.sh"
 N 21 root@pulce4.localdom  Tue Jul  9 08:59   3/693   "Cron <p@pulce4> /home/p/bin/test4.sh"
 N 22 root@pulce4.localdom  Tue Jul  9 08:59   3/695   "Cron <p@pulce4> /home/p/bin/test3.sh"
----






>Fix:




Home | Main Index | Thread Index | Old Index