Solving problems on your own is VERY rewarding!!
I'm going to make this rather quick but I just want to say this...
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...
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!!
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.
|All times are GMT -5. The time now is 12:19 PM.|