Sponsored Content
Top Forums Shell Programming and Scripting Need help in running a script continuously non stop Post 302771592 by balapobi on Thursday 21st of February 2013 04:53:12 AM
Old 02-21-2013
Code:
#!/bin/sh
while true
do
  hour=$(date +"%T")
  if [ "$hour" == 18:30:00 ]; then
    <Do the JOB>
  fi
done


Last edited by Franklin52; 02-21-2013 at 06:46 AM.. Reason: Code tags
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to stop asking password while running shell script?

Hello, I am ftping the file from one unix box to another box. This script works fine. Only problem here is, it is asking the password when ftp the file. How can i stop that. I am providing the password inside the shell script. But it is not accepting this. I need to put this script in crontab.... (5 Replies)
Discussion started by: govindts
5 Replies

2. Shell Programming and Scripting

How to stop the script which is running in background

Hi I have a script, which i ran in background, can someone please help in stopping this. i gave this command: ksh abc.ksh & this script sends me a mail every 30 seconds. i have deleted the script but still i am getting the mails. can some one please help me stopping dese. ... (3 Replies)
Discussion started by: Prateek007
3 Replies

3. Shell Programming and Scripting

How to stop a script running in remote server from local script

Hi, I have googled for quite some time and couldn't able to get what exactly I am looking for.. My query is "how to stop a shell script which is running inside a remote server, using a script"??? can any one give some suggestions to sort this out. (1 Reply)
Discussion started by: mannepalli
1 Replies

4. Shell Programming and Scripting

Shell Script to continuously scan a log file

Hello members, I have some doubts on how to write a script that can reports success / failure of a batch job ? 1. Run a batch job: 2. Wait and search for a particular string in the Log file: tail -f log01*.txt | egrep -v "^SUCCESSFUL" echo "continue with the other tasks" ... (1 Reply)
Discussion started by: novice82
1 Replies

5. Shell Programming and Scripting

Process running? Stop it

I have this "process keepalive" script: #!/bin/bash PIDFILE=/tmp/php.pid PHPSCRIPT=/home/www/mydomain.com/subdomains/www/parser.php echo 'Checking php process from PID file' if ; then PID=`cat $PIDFILE` if ps ax | grep -v grep | grep $PID > /dev/null then echo "php process still... (4 Replies)
Discussion started by: LukasB
4 Replies

6. Shell Programming and Scripting

Run a script continuously for 10 minutes

Hi all!! Im using ksh and my OS is Linux. I want to run a script for ten minutes, starting from my current system time. How to acheive this? Any help appreciated. Thanks in advance (5 Replies)
Discussion started by: Jayaraman
5 Replies

7. Shell Programming and Scripting

Shell Script for continuously checking status of a another script running in background, and immedia

Hi, I want to write a script which continuously checking status of a script running in background by nohup command. And if same script is not running then immediately start the script...please help.. i am using below command to run script nohup system_traps.sh & but in some... (9 Replies)
Discussion started by: ketanraut
9 Replies

8. Shell Programming and Scripting

How to run a process continuously for an hour then stop?

Hi I have a shell script I would like to run it has to run twice a day every 5 seconds for an hour I can do this with cron but I was hoping there was an easier way. Is there a way to make a process sleep only at a certain time of day say between 1 and 2 pm? Or under certain conditions? Any help... (8 Replies)
Discussion started by: Paul Walker
8 Replies

9. Emergency UNIX and Linux Support

Script for pinging continuously

Hi, I need to set up a script that would write the results of the ping command from one AIX server to another file may be every minute. Like this I need to gather the data for a period of 24 hours. Can someone please help me with this? G (5 Replies)
Discussion started by: ggayathri
5 Replies

10. UNIX for Beginners Questions & Answers

Shell script for continuously monitoring log file

Hi I have written below log monitoring script to egrep multiple words and redirect the output to a text file and its working fine but I want to add some more below given functionality to it, which is very advance and im not very good in it, so please help if you can :) I am egrepping all the... (1 Reply)
Discussion started by: scazed
1 Replies
rotatelogs(8)						      System Manager's Manual						     rotatelogs(8)

NAME
rotatelogs - rotate Apache logs without having to kill the server SYNOPSIS
rotatelogs logfile rotationtime [offset] DESCRIPTION
rotatelogs is a simple program for use in conjunction with Apache's piped logfile feature, which can be used like this: CustomLog "|bin/rotatelogs /var/logs/logfile 86400" common This creates the files /var/logs/logfile.nnnn where nnnn is the system time at which the log nominally starts (this time will always be a multiple of the rotation time, so you can synchronize cron scripts with it). At the end of each rotation time (here after 24 hours) a new log is started. OPTIONS
logfile The path plus basename of the logfile. If logfile includes any Otherwise, the suffix .nnnnnnnnnn is automatically added and is the time in seconds. Both formats compute the start time from the beginning of the current period. rotationtime The rotation time in seconds. offset The number of minutes offset from UTC. If omitted, zero is assumed and UTC is used. For example, to use local time in the zone UTC -5 hours, specify a value of -300 for this argument. PORTABILITY
The following logfile format string substitutions should be supported by all strftime(3) implementations, see the strftime(3) man page for library-specific extensions. %A full weekday name (localized) %a 3-character weekday name (localized) %B full month name (localized) %b 3-character month name (localized) %c date and time (localized) %d 2-digit day of month %H 2-digit hour (24 hour clock) %I 2-digit hour (12 hour clock) %j 3-digit day of year %M 2-digit minute %m 2-digit month %p am/pm of 12 hour clock (localized) %S 2-digit second %U 2-digit week of year (Sunday first day of week) %W 2-digit week of year (Monday first day of week) %w 1-digit weekday (Sunday first day of week) %X time (localized) %x date (localized) %Y 4-digit year %y 2-digit year %Z time zone name %% literal `%' SEE ALSO
httpd(8) March 2001 rotatelogs(8)
All times are GMT -4. The time now is 09:58 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy