Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - General > Member Success Stories
User Name
Password Member Success Stories Just spent four hours configuring your favorite program? Just figured out a Linux problem that has been stumping you for months?
Post your Linux Success Stories here.


  Search this Thread
Old 02-09-2011, 06:57 PM   #1
LQ Newbie
Registered: Nov 2010
Posts: 5

Rep: Reputation: 0
Talking Solving problems on your own is VERY rewarding!!

I'm going to make this rather quick but I just want to say this...


sudo top -b -n 1 > /home/admin/stats.txt

sudo sendEmail -v -f -s -xu myusername -xp mypasswd -t -o tls=yes -u Server Statistics -m Your server is up and running normally -a /home/admin/stats.txt
THIS has been giving me hell for almost three days now. I've been using Linux as my primary desktop OS for almost a year now and I built my own server about 2 months ago. I saved myself A **TON** of money by using an Open Source/GNU OS and basically "recycling" a buddy's old tower. Current specs as of 02/09/11...

Case: Dell Dimension XPS r450
Processor: Pentium II [Deschutes (80523)] @ 450mhz w/ 512mb L2 cache
RAM: 768mb RAM (384mb listed "maximum", hacked it to use 768mb)
HDD: 2 IDE, 2 SATA/USB - 2TB total
OS: Ubuntu 10.04 LTS Server

Original cost (bone stock): $2729 in October 1998

Total cost for me: $200

Long story short, I built the thing up to use as a file server (streaming music/video/TV) and my LANs manager for OSSEC-HIDS, as well as daily backups of all my computers.

I wrote the script to (in essence) take a simple "snapshot" of the current processes/usage and then email it to me at 1100hrs daily via a cronjob.

I could run the script manually from my ~/ directory and it worked beautifully, but as a cronjob, it never updated the *.txt file. So I was receiving the same data on every job, every day for three days.

I did a bit of hacking around with cron and to my amazement (well, not really... I should've figured) it needs a FULLY QUALIFIED DIRECTORY for every time it interacts with a file. My original script said...

sudo top -b -n 1 > stats.txt
and it needed to be...

sudo top -b -n 1 > /home/admin/stats.txt

I was in the process of typing out the question hear on LQ when I suddenly had a "light bulb" moment! I edited the script, ran the cron manually and VOILA!! PERFECT!

Perseverance goes a LONG way, my friends!! It's ALWAYS OK to ask questions... but once you can figure it out on your own... trust me, it's the best feeling in the world!!

Old 02-09-2011, 07:11 PM   #2
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,134
Blog Entries: 2

Rep: Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839
You are absolute right. Solving problems oneself is a really good thing.
Just a side-note: There should be no need for sudo here. I would strongly recommend to run commands as root only when needed.


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
LXer: Solving resource contention problems with fuser LXer Syndicated Linux News 0 11-14-2007 06:30 PM
scripting guru wanted (low pay but emotionally rewarding) dasbooter Programming 9 08-16-2005 06:49 PM
solving dependency problems on Suse 9.1 prosh0t Linux - Software 16 03-01-2005 11:09 AM
Solving my Headache Sophic Linux - Wireless Networking 6 03-29-2004 11:27 AM
Solving problems with Linux jamaso Linux - General 3 02-08-2002 06:36 PM > Forums > Linux Forums > Linux - General > Member Success Stories

All times are GMT -5. The time now is 11:39 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