Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Crontab export MAILTO="" problem
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
billydv
l33t
l33t


Joined: 22 Dec 2006
Posts: 911
Location: Mount Vernon, NY

PostPosted: Wed Feb 11, 2009 1:26 pm    Post subject: Crontab export MAILTO="" problem Reply with quote

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
View user's profile Send private message
billydv
l33t
l33t


Joined: 22 Dec 2006
Posts: 911
Location: Mount Vernon, NY

PostPosted: Thu Feb 12, 2009 3:28 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
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