You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be great if there was a quiet option that would emit nothing if no error or warnings were found, but would emit the warning or error if one is found.
Use case is to have chkcrontab running from a file in /etc/cron.d on a regular basis so any errors that slipped in will be picked up and emailed to root.
so a cron entry like:
5 * * * * root for i in /etc/cron.d/*; do /usr/local/bin/chkcrontab -q $i ; done
would only email the user if an error was detected.
The text was updated successfully, but these errors were encountered:
I'd like no output unless there's an error as well.
#!/bin/bash
while IFS= read -r -d '' file
do
if ! status=$(/usr/local/bin/chkcrontab "$file" 2>&1); then
echo "$status"
fi
done < <(find /etc/cron.d /var/spool/cron/crontabs -type f -mmin 2 -print0)
It would be great if there was a quiet option that would emit nothing if no error or warnings were found, but would emit the warning or error if one is found.
Use case is to have chkcrontab running from a file in /etc/cron.d on a regular basis so any errors that slipped in will be picked up and emailed to root.
so a cron entry like:
would only email the user if an error was detected.
The text was updated successfully, but these errors were encountered: