Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 03-29-2011, 02:07 PM   #1
LQ Newbie
Registered: Mar 2011
Posts: 14

Rep: Reputation: 0
df output to root's mail box

Hey all,

First of all I'm using RHEL 5.

I'm trying to make a script in my /etc/cron.d directory called df. Anyways, I want to be able to have it run the df command every hour, 23 minutes past the hour.

I have the first part, I just need assistance in directing it to roots mail box.

23 * * * * root df > (what do I put here?)

Thanks in advance
Old 03-29-2011, 02:11 PM   #2
LQ 5k Club
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,528

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Welcome to LQ

You can use
/bin/df | /bin/mail -s"email subject" root
Kind regards

Last edited by repo; 03-29-2011 at 02:15 PM.
1 members found this post helpful.
Old 03-30-2011, 04:09 AM   #3
Registered: Jan 2010
Posts: 418

Rep: Reputation: 83
I use msmtp under Fedora 13
I wrote this one line script I call stdin-email.bash:
(echo -e "Subject: Done";echo;cat -) |msmtp -t
then you can use it this way:

I find it better to email to an account outside of my machine, this way, I see it instantly on my mobile phone.

Otherwise, repo's answer is good too!


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
split mail received in local mail box into different files golden_boy615 Linux - General 1 10-30-2010 12:13 PM
Sending root mail to an external mail account aquaboot Debian 13 01-09-2009 08:23 PM
Build a mail box for internal and external mail Corsari Linux - Server 9 11-12-2007 06:50 AM
Unable to open mail spool file /var/mail/root cccc Debian 4 09-14-2006 02:31 PM
/dev/ht0 is writing output to /var/spool/mail/root getza1 Linux - Software 0 04-09-2006 04:00 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:26 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration