script to run repeatedly after a fixed interval of time


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting script to run repeatedly after a fixed interval of time
# 1  
Old 11-20-2008
script to run repeatedly after a fixed interval of time

Hi ,

I am working on the following script . I want this script to run and scan the log file repeatedly after 3 hours. This script will run & scan just for the current date logs and after every 3 hours. Kindly advice what to add in this script for this purpose.

#!/bin/sh
diff common.log common.log.1 > DIFFERENCE.log
cp common.log common.log.1
grep "DEBUG" DIFFERENCE.log
if [ $? -eq 0 ]; then
echo "1"
else
echo "0"
fi



Regards
# 2  
Old 11-20-2008
Learn to use crontab. This will let you schedule a job at intervals.
# 3  
Old 11-20-2008
You can use cronjobs...
# 4  
Old 11-20-2008
Crontab can help you
try 'man 5 crontab'
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Run Bash Script thrice & then interval for 10 mins.

Hi... I am very new to shell scripting. I have written a script with help of this forum and some googling and it works the way I want it to. Currently this script checks for my SIP trunk registration every 5 seconds, if registration is not available then it reboots my router through telnet... (4 Replies)
Discussion started by: jeetz
4 Replies

2. Shell Programming and Scripting

Main script triggers second and it has to run at specific interval

Hi Friends, I am newbie to shell programming and I am stuck trying to accomplish following task.We use Bamboo CI which executes script1 passing parameters. This Main script executes script2 as backend process as part of one of it statements. Task of script2 is to essentially check whether a... (0 Replies)
Discussion started by: aditya206
0 Replies

3. Shell Programming and Scripting

Mailing a file at a particular time interval

Folks, I need to send a .log file to my email for every one hour from a server that too only in a particular time period. Is awk mandate here? or can we do it in shell scripting only? Please help me in sorting this out. Cheers, Arun (3 Replies)
Discussion started by: ArunJanga
3 Replies

4. Shell Programming and Scripting

How to run a script everyday between 7 and 8 pm with the time interval of 5 minutes?

Hi, Can someone help me in running a cronjob everyday between 7 and 8 pm with the time interval of 5 minutes in between to repeat that script. The script is so small and I need that to run daily between this time. Please if possible provide me the syntax for this logic. Thanks. (4 Replies)
Discussion started by: cya
4 Replies

5. UNIX for Dummies Questions & Answers

Copying files between two time interval

Hi All, I am new to this forum.... Can neone please help me how to copy files between two time intervals i.e. I need to copy files from 6.30 to 9.30 on 5th June 09. Any help is appreciated. (2 Replies)
Discussion started by: Pratik4891
2 Replies

6. UNIX for Dummies Questions & Answers

Run script in the background with a time interval

I have a script I want to run in the background, and I have looked it up but I am not exactly sure how to do. First of all to run it in the background do you have to put something in the script or is it just a command when you go to run it. I found this solution to it but once again I am not to... (2 Replies)
Discussion started by: mauler123
2 Replies

7. Shell Programming and Scripting

System time comparison to fixed defined time

I have a requirement of checking the current system time and performing certain actions in a shell script. example: if the current system time is greater than 1400 hrs, then perform step 1,2,3 if the current system time is greater than 1000 hrs, then perform step 1,2 if the current system time... (2 Replies)
Discussion started by: zainravi
2 Replies

8. Shell Programming and Scripting

run script 1 minute interval without CronTab

I am using Solaris 9. I wish to run my script every 1 minute inteval. Though i can run it using below entry in crontab. * * * * /export/home/username/script/file_exist_&_run.sh in short above script will check whether a specific file exist in a directory. If it found it will inovke another... (10 Replies)
Discussion started by: thepurple
10 Replies

9. Shell Programming and Scripting

Shell Script Run Interval to be dynamic

Hi All. I have a script which has to be run periodically. The frequency of its run will be decided by a Database stored value PollRate. e.g. If PollRate value is 300secs, then the script should be executed every 5 minutes, if it's 1500secs, it should execute every 15 minutes. Is there... (5 Replies)
Discussion started by: rahulrathod
5 Replies

10. Solaris

Time Wait interval

What is the time_wait interval for Solaris 8/9??? and is it configurable??? For example sometimes a clients pc will freeze up dropping the connection, closing the port. The problem is on our side our system still thinks their logged in (until it realizes it dropped on the otherside and drops on... (1 Reply)
Discussion started by: eloquent99
1 Replies
Login or Register to Ask a Question