Sponsored Content
Top Forums Shell Programming and Scripting script to run repeatedly after a fixed interval of time Post 302260299 by himvat on Thursday 20th of November 2008 05:57:21 AM
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
 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
PMFETCHARCHIVE(3)					     Library Functions Manual						 PMFETCHARCHIVE(3)

NAME
pmFetchArchive - get performance metrics directly from an archive log C SYNOPSIS
#include <pcp/pmapi.h> int pmFetchArchive(pmResult **result); cc ... -lpcp DESCRIPTION
pmFetchArchive is a variant of pmFetch(3) that may only be used when the current Performance Metrics Application Programming Interface (PMAPI) context is associated with an archive log. The result is instantiated with all of the metrics (and instances) from the next archive record, consequently there is no notion of a list of desired metrics, and the instance profile of the PMAPI context is ignored. It is expected that pmFetchArchive would be used to create utilities that scan archive logs, while the more common access to the archives would be via the pmFetch(3) interface. To skip records within the archive log, use pmSetMode(3) to change the collection time within the current PMAPI context, then call pmFetchArchive. Note that the result returned by pmFetchArchive is dynamically allocated, and must be released using pmFreeResult(3), not free(3C). See pmFetch(3) and pmFreeResult(3) for further details. pmFetchArchive returns zero on success. SEE ALSO
PMAPI(3), pmFetch(3), pmFreeResult(3), pmNewContext(3), pmSetMode(3) and pmTrimNameSpace(3). DIAGNOSTICS
PM_ERR_NOTARCHIVE the current PMAPI context is not associated with an archive log Performance Co-Pilot PCP PMFETCHARCHIVE(3)
All times are GMT -4. The time now is 03:55 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy