nixCraft Linux Forum

nixCraft

Linux Tech Support Forum

run a command automatically after every 10 mins

This is a discussion on run a command automatically after every 10 mins within the Shell scripting forums, part of the Development/Scripting category; Hi friends, I need to write a script which runs a command (on that particular server only) after every 10 ...


Go Back   nixCraft Linux Forum > Development/Scripting > Shell scripting

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 11-01-2007, 05:10 PM
Member
User
 
Join Date: Oct 2007
My distro: Linux RHEL 5
Posts: 33
Rep Power: 0
vikas027 is on a distinguished road
Question run a command automatically after every 10 mins

Hi friends,

I need to write a script which runs a command (on that particular server only) after every 10 mins, and the contents are also echoed on that very terminal only.
And then I need to compare the last two outputs, and mail if there is any difference in the last two outputs.
Can we set some alerts, say a machine beeps if the last two outputs have some difference.
Thats my total job.

I think I can do the rest part of it,

BUT

first I want to know how can I run a command automatically after every 10 mins, and dislpay its contents on the terminal.

Pls help, I am a newbie still learning.

Thanks in adv.

Regards,
Vikas
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 11-01-2007, 07:24 PM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
My distro: Any distro with shell
Posts: 967
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

Quote:
Originally Posted by vikas027 View Post
first I want to know how can I run a command automatically after every 10 mins, and dislpay its contents on the terminal.
Write a script
Setup a cron job to run every 10 min i.e. call this script using cron job. See how to use cron job:

How do I add jobs to cron under Linux or UNIX oses?

Good luck!
__________________
Vivek | My personal blog
Linux Evangelist
Play hard stay cool
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

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
How to start Apache2 automatically at boot satimis Web servers 2 02-03-2008 06:03 PM
/tmp clean directory automatically using tmpwatch tanachi Getting started tutorials 4 05-24-2007 10:58 AM
Automatically restart unix daemon raj Linux software 2 12-16-2006 11:29 AM
Dynamic DNS , should get updates automatically from DHCP sonaikar Linux software 1 03-28-2005 12:14 PM
How to update DNS through DHCP automatically sonaikar Shell scripting 1 03-16-2005 06:42 PM


All times are GMT +5.5. The time now is 05:47 AM.


Powered by vBulletin® Version 3.7.3 - Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36