InvoiceBerry Blog

Our thoughts & tips on small businesses, freelancers and sole traders

How to disable the mail alert when running cron jobs (crontab)

Written by on August 22, 2011

By default you will always receive an email to your local email account whenever a cron job either does not work or wants to output something.
To deactivate this you have to do the following.

First open your cron jobs…
[bash]
$ crontab -e
[/bash]

…and then either put:
[php]
>/dev/null 2>&1
[/php]

…or:
[php]
&> /dev/null
[/php]

…at the end of the line of the command.

Your cron job will then look like:
[php]
* * * * * /path/to/my/script.sh >/dev/null 2>&1
[/php]

or:
[php]
* * * * * /path/to/my/script.sh &> /dev/null
[/php]

Save the file. Done.

Create your invoice in just 60 seconds.

Create and send your invoice in under a minute. For free. Forever.
Sign up today to see just how easy invoicing can be.


Ready to start invoicing your clients with InvoiceBerry?

Sign up to our Forever Free account. Yes, it's really free.

Don't leave us yet!

Subscribe to our weekly digest!

Sign up to our newsletter to receive our weekly email digest every Friday morning and read about the best freelancing and small business articles on InvoiceBerry.

Read previous post:
We’re featured in entrepreneur country!

The managing director and founder of Invoiceberry was interviewed by entrepreneur country and we are featured in this month's edition...

Close