View previous topic :: View next topic |
Author |
Message |
billydv l33t
Joined: 22 Dec 2006 Posts: 911 Location: Mount Vernon, NY
|
Posted: Wed Feb 11, 2009 1:26 pm Post subject: Crontab export MAILTO="" problem |
|
|
I run an update script daily through crontab and I am trying to avoid getting emails about this one particular cron job but no matter what I put in I still get emails. Here is my crontab
# for vixie cron
#
# $Header: /var/cvsroot/gentoo-x86/sys-process/vixie-cron/files/crontab-3.0.1-r4,v 1.1 2005/03/04 23:59:48 ciaranm Exp $
#
#
# Global variables
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/kde/3.5/bin
MAILTO=root
HOME=/
# check scripts in cron.hourly, cron.daily, cron.weekly and cron.monthly
0 * * * * root rm -f /var/spool/cron/lastrun/cron.hourly
1 3 * * * root rm -f /var/spool/cron/lastrun/cron.daily
15 4 * * 6 root rm -f /var/spool/cron/lastrun/cron.weekly
30 5 1 * * root rm -f /var/spool/cron/lastrun/cron.monthly
*/10 * * * * root test -x /usr/sbin/run-crons && /usr/sbin/run-crons
15 8 * * 5 root /usr/bin/layman -S
45 1 * * * root export HOME=/home/billydv && export DISPLAY=:0 && konsole --noclose -e update-daily
My problem lies with the last job on the crontab. I have tried adding in export MAILTO="" and also export MAILTO="/dev/null" but neither seems to prevent the unwanted emails. What is the proper export variable that I need to insert in order to avoid emails? _________________ Billy DeVincentis |
|
Back to top |
|
|
billydv l33t
Joined: 22 Dec 2006 Posts: 911 Location: Mount Vernon, NY
|
Posted: Thu Feb 12, 2009 3:28 am Post subject: |
|
|
Okay, I believe I have found the trick, I modified to this and it seems to work
45 1 * * * root export HOME=/home/billydv;export DISPLAY=:0;konsole --noclose -e update-daily >> /dev/null 2>&1
seems that adding
>> /dev/null 2>&1
to the end of a cronjob deletes all terminal output _________________ Billy DeVincentis |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|