Go Back   Technology Questions > Software Questions > Operating System Questions > Linux

Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old 01-15-2007, 12:02 PM
Beowulf
Tablet PC Guest
 
Posts: n/a
cron.daily bash scripting question

I created the text file below, wrote it to /etc/cron.daily/aide and
made it readable, writeable. and executable by root (same permissions as
other scripts in /etc/cron.daily/). Is this all I need to do have this
bash script run daily? Or do I need to edit some special cron file of some
sort? Does the syntab look ok in this file? This is my first attempt at a
cron job using a bash script. (email address is of course bogus). Any
assistance appreciated.

#!/bin/sh
# Advanced Intrusion Detection System (aide) report
/usr/bin/aide --check -V2 > /home/beowulf/aide-check.txt
cat /home/beowulf/aide-check.txt | mailx -s "Report" me@wherever.com
# End of file.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

 
Old 01-15-2007, 12:02 PM
Xploder HD Movie Player for PS3. Manage, convert and transfer media files between the PC and PS3.
  #2 (permalink)  
Old 01-15-2007, 12:02 PM
Bit Twister
Tablet PC Guest
 
Posts: n/a
Re: cron.daily bash scripting question

On Sun, 24 Dec 2006 10:20:13 -0600, Beowulf wrote:
> I created the text file below, wrote it to /etc/cron.daily/aide and
> made it readable, writeable. and executable by root (same permissions as
> other scripts in /etc/cron.daily/). Is this all I need to do have this
> bash script run daily?


Should work. Want to test it, Try it, by hand
/etc/cron.daily/aide
then if you like,
nice -n 19 run-parts --report /etc/cron.daily
that is what crontab will do, see cat /etc/crontab


> cat /home/beowulf/aide-check.txt | mailx -s "Report" me@wherever.com


You might verify this works

echo "test shot" > /home/beowulf/aide-check.txt

mailx -s "Report" me@wherever.com < /home/beowulf/aide-check.txt

You may want to add
chown beowulf:beowulf /home/beowulf/aide-check.txt
to your script.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #3 (permalink)  
Old 01-15-2007, 12:02 PM
Beowulf
Tablet PC Guest
 
Posts: n/a
Re: cron.daily bash scripting question

On Sun, 24 Dec 2006 10:31:44 -0600, Bit Twister wrote:
> Should work. Want to test it, Try it, by hand
> /etc/cron.daily/aide
> then if you like,
> nice -n 19 run-parts --report /etc/cron.daily
> that is what crontab will do, see cat /etc/crontab


Thank you, I will try it when I get home (at coffee shop now with notebook
pc)


> You may want to add
> chown beowulf:beowulf /home/beowulf/aide-check.txt to your script.


Ok, thanks.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Reply

Bookmarks

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
mail program for IDS/cron? Beowulf Linux 5 01-15-2007 12:01 PM
daily log of events Shan Windows XP 1 01-04-2007 06:54 AM
daily log of events Shan Windows XP 1 01-04-2007 06:54 AM
Attn: Ramesh or anyone (Question about scripting for Add/Remove Programs) Trevor Windows XP 6 01-04-2007 04:00 AM
What is it like to use a Tablet PC on a daily basis? LPH Tablet PC Tips & Tricks 1 04-06-2004 07:33 AM


All times are GMT -8. The time now is 02:08 PM.


2003 - 2008 All Rights Reserved. Technology Questions

SEO by vBSEO 3.1.0