LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 03-29-2011, 01:07 PM   #1
deeneyc09
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, 01:11 PM   #2
repo
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
Code:
/bin/df | /bin/mail -s"email subject" root
Kind regards

Last edited by repo; 03-29-2011 at 01:15 PM.
 
1 members found this post helpful.
Old 03-30-2011, 03:09 AM   #3
16pide
Member
 
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:
Quote:
#!/bin/bash
(echo -e "Subject: Done";echo;cat -) |msmtp -t xyz@example.com
then you can use it this way:
df|stdin-email.bash

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!
 
  


Reply


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 11:13 AM
Sending root mail to an external mail account aquaboot Debian 13 01-09-2009 07:23 PM
Build a mail box for internal and external mail Corsari Linux - Server 9 11-12-2007 05:50 AM
Unable to open mail spool file /var/mail/root cccc Debian 4 09-14-2006 01:31 PM
/dev/ht0 is writing output to /var/spool/mail/root getza1 Linux - Software 0 04-09-2006 03:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:53 PM.

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