03-18-2013
Setting time for running of the script
Dear all,
I wonder if it is possible that we can run the script
from time to time..I meant, it should repeat the
sourcing of the script by itself? In my case, I need
to source this script manually from time to time,
like once in every 10 minutes.
emily,
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
how can i compare the latest log file with the current time..
consider i am running a script "a.sh" at 09:00
( function of the script a.sh is to update the database )
this script is going to create logfile if the script is sucess
in case of failure it is not going to create logfile..
... (0 Replies)
Discussion started by: mail2sant
0 Replies
2. Shell Programming and Scripting
hi is there any way i can display a countdown time needed to run a script? like load a counter at the beginning of the script with the estimated time and display the counter decrementing till it finishes running the script? (3 Replies)
Discussion started by: npatwardhan
3 Replies
3. Shell Programming and Scripting
Hi
I have a script that performs a process on a file.
I want to know how to include a function to run a batch of files?
Here is my script
#!/bin/bash
#----------------------------------------------------------------------------------------------------------------------
#This... (2 Replies)
Discussion started by: ladyAnne
2 Replies
4. Emergency UNIX and Linux Support
Dear Forum experts
I have the below script which I made to run under bash shell, it runs perfectly for low records number, let us say like 100000. when I put all records (3,000,000), it's takes hours
can you please suggest anything to optimize or to run in different way :-|
{OFS="|";... (6 Replies)
Discussion started by: yahyaaa
6 Replies
5. Shell Programming and Scripting
Unix Gurus,
I have a requirement where the shell script needs to do specific tasks after certain period of time.
Daily we receive few files in a particular folder. The script does the file renaming, pass parameters to run some web services and pushes to remote FTP location.
But my... (3 Replies)
Discussion started by: shankar1dada
3 Replies
6. Shell Programming and Scripting
Hi All,
newbie here, I'm just wondering how can i know the exact running time of my script?
Please advise,
THanks, (1 Reply)
Discussion started by: nikki1200
1 Replies
7. Shell Programming and Scripting
HI Guys,
I want to find out the script running time and subtract from sleeptime.
My Script Below Give me error :-
#!/usr/bin/ksh
timeout=100
start=$SECONDS
sleep 20
end=$SECONDS
echo "Time: $((end - start)) "
ScTime = $((end - start)) (1 Reply)
Discussion started by: asavaliya
1 Replies
8. Shell Programming and Scripting
Hi,
I want to write a script that does some sort of health check on the database. It will query the database for information, some query takes long and some are quick.
For example, inside the script I will do something as below:
#!/bin/ksh
run_query_01 &
run_query_02 &... (1 Reply)
Discussion started by: newbie_01
1 Replies
9. Shell Programming and Scripting
Hi,
I need a script to kill the process if it running for long time.
Inputs for the scripts:
1.test.sh (will be running fron cron scheduler)
2.1 hr (ie threshold_time - if the test.sh is running for more than 1 hr test.sh has to kill)
Thanks,
Divya (1 Reply)
Discussion started by: Divya Nochiyil
1 Replies
10. Shell Programming and Scripting
I am running a script which will read the data from fail line by line and call the Java program by providing the arguments from the each line.
The Java code is working fast for few records and for some records its getting hanged not providing response for morethan one hour.
Currently am... (4 Replies)
Discussion started by: dineshaila
4 Replies
LEARN ABOUT OPENDARWIN
after
after(n) Tcl Built-In Commands after(n)
__________________________________________________________________________________________________________________________________________________
NAME
after - Execute a command after a time delay
SYNOPSIS
after ms
after ms ?script script script ...?
after cancel id
after cancel script script script ...
after idle ?script script script ...?
after info ?id?
_________________________________________________________________
DESCRIPTION
This command is used to delay execution of the program or to execute a command in background sometime in the future. It has several forms,
depending on the first argument to the command:
after ms
Ms must be an integer giving a time in milliseconds. The command sleeps for ms milliseconds and then returns. While the command is
sleeping the application does not respond to events.
after ms ?script script script ...?
In this form the command returns immediately, but it arranges for a Tcl command to be executed ms milliseconds later as an event
handler. The command will be executed exactly once, at the given time. The delayed command is formed by concatenating all the
script arguments in the same fashion as the concat command. The command will be executed at global level (outside the context of
any Tcl procedure). If an error occurs while executing the delayed command then the bgerror mechanism is used to report the error.
The after command returns an identifier that can be used to cancel the delayed command using after cancel.
after cancel id
Cancels the execution of a delayed command that was previously scheduled. Id indicates which command should be canceled; it must
have been the return value from a previous after command. If the command given by id has already been executed then the after can-
cel command has no effect.
after cancel script script ...
This command also cancels the execution of a delayed command. The script arguments are concatenated together with space separators
(just as in the concat command). If there is a pending command that matches the string, it is cancelled and will never be executed;
if no such command is currently pending then the after cancel command has no effect.
after idle script ?script script ...?
Concatenates the script arguments together with space separators (just as in the concat command), and arranges for the resulting
script to be evaluated later as an idle callback. The script will be run exactly once, the next time the event loop is entered and
there are no events to process. The command returns an identifier that can be used to cancel the delayed command using after can-
cel. If an error occurs while executing the script then the bgerror mechanism is used to report the error.
after info ?id?
This command returns information about existing event handlers. If no id argument is supplied, the command returns a list of the
identifiers for all existing event handlers created by the after command for this interpreter. If id is supplied, it specifies an
existing handler; id must have been the return value from some previous call to after and it must not have triggered yet or been
cancelled. In this case the command returns a list with two elements. The first element of the list is the script associated with
id, and the second element is either idle or timer to indicate what kind of event handler it is.
The after ms and after idle forms of the command assume that the application is event driven: the delayed commands will not be executed
unless the application enters the event loop. In applications that are not normally event-driven, such as tclsh, the event loop can be
entered with the vwait and update commands.
SEE ALSO
bgerror(n), concat(n), update(n), vwait(n)
KEYWORDS
cancel, delay, idle callback, sleep, time
Tcl 7.5 after(n)