[nmglug] cron e-mail /dev/null

Jason Schaefer js at jasonschaefer.com
Mon Jan 25 10:23:56 PST 2010


On Mon, Jan 25, 2010 at 5:52 AM, a <a at kaluta.us> wrote:
> When there is "*.jpg" content the cronjob successfully reads:
> "/home/kaluta/kaluta.us/jerry-camera/*.jpg".
>
> When there is not "*.jpg" content (i.e. camera off). I am e-mailed the
> following message hourly by cron:
> "/usr/bin/find: /home/kaluta/kaluta.us/jerry-camera/*.jpg: No such file"
> or directory.

Hey Anthony

The solution is very simple. Add > /dev/null 2>&1 to the end of your
command(s) inside your cron.
steps to follow:
1. crontab -e
2. add "> /dev/null 2>&1" to the end of the lines you don't want to
received any notifications for. (without the quotes)
3. save

This redirects (>) the standard output (1) and standard error (2) of
the command to /dev/null (the black hole of nix)

>
> Can anyone suggest a method of avoiding the "superfluous" hourly e-mail.
> tnx, Anthony
>
>
>
>
> _______________________________________________
> nmglug mailing list
> nmglug at nmglug.org
> https://nmglug.org/mailman/listinfo/nmglug
>



More information about the nmglug mailing list