How to make the script to sleep for 30 min..?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to make the script to sleep for 30 min..?
# 1  
Old 04-25-2011
How to make the script to sleep for 30 min..?

Hi

I have a script 'A' after it runs i want to sleep this for 30 min, after 30 min it should re run.
How do i do that ..!


thanks in advance
# 2  
Old 04-25-2011
Code:
while true
do
        stuff
        sleep 1800
done

Or you could put it in your crontab to get run every 30 minutes.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Sleep then start over from beginning of script

Hi all, I have a bash script in which it runs multiple if conditions if a word count from a grep is equal to a number. When this number is not reached I want to sleep for very few seconds (let's say 3) and start over again, till it matches the word count of 8. Here's a sample of the code so... (6 Replies)
Discussion started by: nms
6 Replies

2. Shell Programming and Scripting

Script to find min for each unique value

I need a script that will search through multiple files and when the first 2 columns match, print out Columns 1 and 2 and the minimum value. File 1 24.01 -81.01 1.0 24.02 -81.02 1.0 24.03 -81.03 3.0 File 2 24.01 -81.01 5.0 24.02 -81.02 3.0 24.03 -81.03 ... (3 Replies)
Discussion started by: ncwxpanther
3 Replies

3. Shell Programming and Scripting

awk script to find min and max value

I need to find the max/min of columns 1 and 2 of a 2 column file what contains the special character ">". I know that this will find the max value of column 1. awk 'BEGIN {max = 0} {if ($1>max) max=$1} END {print max}' input.file But what if I needed to ignore special characters in the... (3 Replies)
Discussion started by: ncwxpanther
3 Replies

4. Shell Programming and Scripting

[Solved] How to make the script jump to sleep?

Hi Gurus, I am working one below script. I am stuck at the else condition. #!/bin/ksh while : do cur_date=`date |cut -d"," -f 1` cur_time=`date +"%H%M" if ||; then if && ; then echo "File " $FIRST_FILE "... (8 Replies)
Discussion started by: ken6503
8 Replies

5. Shell Programming and Scripting

How to check the status of script for every 5 min?

Hi, Can any1 provide the code for my req: I am loading few set of files into database through one unix script. I ll try to describe the process: load_cdr-->main script Source Feeds are A & B. File in A-akm.dat File in B-bkm.dat Now my script runs through cron jobs everyday...and for both... (6 Replies)
Discussion started by: gnnsprapa
6 Replies

6. UNIX for Dummies Questions & Answers

Run a script if file modified in last 10 min

Hi, I want to check if a file is modified or not in the last 10 mins and run a script if so. Thanks (8 Replies)
Discussion started by: krabu
8 Replies

7. Shell Programming and Scripting

Script to send an alert if a file is present in a directory for 10 min

hi, A script which look into a directory and send an alert via a mail. If there is any file exisiting in a directory for more then 10 min. (5 Replies)
Discussion started by: madfox
5 Replies

8. Shell Programming and Scripting

Kill a Script based on the pid and sleep

I would want to run a code for 1 min and if it doesnt succeed in 1 min..I would want to exit it..I am using the following code...But the script is not going into my code part.It is waiting for 60 secs and then getting killed. The code which is in the while loop actually takes less than 60 secs...... (6 Replies)
Discussion started by: infernalhell
6 Replies

9. Shell Programming and Scripting

Wrapping 'sleep' with my 'resleep' function (Resettable sleep)

This is a very crude attempt in Bash at something that I needed but didn't seem to find in the 'sleep' command. However, I would like to be able to do it without the need for the temp file. Please go easy on me if this is already possible in some other way: How many times have you used the... (5 Replies)
Discussion started by: deckard
5 Replies

10. Shell Programming and Scripting

how to start a process and make it sleep for 5 mins and then kill that process

how to start a process and make it sleep for 5 mins and then kill that process (6 Replies)
Discussion started by: shrao
6 Replies
Login or Register to Ask a Question