Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Script should keep running only at specific time Post 303045249 by Syedsabeel on Saturday 14th of March 2020 11:24:41 AM
Old 03-14-2020
If there is a server failure or reboot. I have to run the script again as the process gets killed surely.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Ending script at specific time.

Hello Everybody.. I've written the script that kick off through CRON job and kill itself by specific time. I've start time and end time specify in env file. i.e START_TIME=1500 (03:00 PM) END_TIME=0600 (06:00 AM) It always works good if my START_TIME is before midnight and my... (4 Replies)
Discussion started by: nirav_soni
4 Replies

2. Shell Programming and Scripting

Running batches of files at a time from a script

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

3. Emergency UNIX and Linux Support

Help to optimize script running time

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

4. Shell Programming and Scripting

Help in running a script after a particular time

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

5. Shell Programming and Scripting

How to know the exact running time of script!

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

6. Shell Programming and Scripting

script for get lines with specific time.

i want to make a script for grep any lines with key word and every time (5 min) Ex. Log in Server. . . . 03-01-2012 03:07:54,924 - INFO MessageUtil - Return | Status=0 | TxID=12010300000548755292 | Message=Success 03-01-2012 03:09:13,789 - INFO MessageUtil - Return | Status=0 |... (6 Replies)
Discussion started by: ooilinlove
6 Replies

7. Shell Programming and Scripting

Help with kill a specific process after certain running time

Hi, Do anybody experience to write a bash script in order to kill a specific process (java) after certain time of running? eg. java java.jar task_run.txt I will run a java program (java.jar) which will run a long list of process (task_run.txt) one by one. I plan to terminate the java... (5 Replies)
Discussion started by: perl_beginner
5 Replies

8. Shell Programming and Scripting

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, (2 Replies)
Discussion started by: emily
2 Replies

9. Shell Programming and Scripting

Example of running script with time limits?

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

10. Shell Programming and Scripting

Running script in crontab in a specific directory

I am trying to run a script from crontab but the entire script (which is 70+ lines) is written in bash and I need it to run from a certain directory. So when I run it manually I cd to /local/mnt/scr and then type ./reordersc and it works fine. However, I want it to run from the crontab and I... (20 Replies)
Discussion started by: newbie2010
20 Replies
INIT(8) 						      System Manager's Manual							   INIT(8)

NAME
init - process control initialization SYNOPSIS
/etc/init DESCRIPTION
Init is invoked inside UNIX as the last step in the boot procedure. It normally then runs the automatic reboot sequence as described in reboot(8), and if this succeeds, begins multi-user operation. If the reboot fails, it commences single user operation by giving the super- user a shell on the console. It is possible to pass parameters from the boot program to init so that single user operation is commenced immediately. When such single user operation is terminated by killing the single-user shell (i.e. by hitting ^D), init runs /etc/rc with- out the reboot parameter. This command file performs housekeeping operations such as removing temporary files, mounting file systems, and starting daemons. In multi-user operation, init's role is to create a process for each terminal port on which a user may log in. To begin such operations, it reads the file /etc/ttys and executes a command for each terminal specified in the file. This command will usually be /usr/libexec/getty. Getty opens and initializes the terminal line, reads the user's name and invokes login to log in the user and execute the Shell. Ultimately the Shell will terminate because of an end-of-file either typed explicitly or generated as a result of hanging up. The main path of init, which has been waiting for such an event, wakes up and removes the appropriate entry from the file utmp, which records cur- rent users, and makes an entry in the wtmp, file which maintains a history of logins and logouts. The wtmp entry is made only if a user logged in successfully on the line. Then the appropriate terminal is reopened and getty is reinvoked. Init catches the hangup signal (signal SIGHUP) and interprets it to mean that the file /etc/ttys should be read again. The Shell process on each line which used to be active in ttys but is no longer there is terminated; a new process is created for each added line; lines unchanged in the file are undisturbed. Thus it is possible to drop or add terminal lines without rebooting the system by changing the ttys file and sending a hangup signal to the init process: use `kill -HUP 1.' Init will terminate multi-user operations and resume single-user mode if sent a terminate (TERM) signal, i.e. ``kill -TERM 1''. If there are processes outstanding which are deadlocked (due to hardware or software failure), init will not wait for them all to die (which might take forever), but will time out after 30 seconds and print a warning message. Init will cease creating new getty's and allow the system to slowly die away, if it is sent a terminal stop (TSTP) signal, i.e. ``kill -TSTP 1''. A later hangup will resume full multi-user operations, or a terminate will initiate a single user shell. This hook is used by reboot(8) and halt(8). Init's role is so critical that if it dies, the system will reboot itself automatically. If, at bootstrap time, the init process cannot be located, the system will loop in user mode at location 0x13. DIAGNOSTICS
/usr/libexec/getty gettyargs failing, sleeping. A process being started to service a line is exiting quickly each time it is started. This is often caused by a ringing or noisy terminal line. Init will sleep for 30 seconds, then continue trying to start the process. WARNING: Something is hung (wont die); ps axl advised. A process is hung and could not be killed when the system was shutting down. This is usually caused by a process which is stuck in a device driver due to a persistent device error condition. FILES
/dev/console, /dev/tty*, /var/run/utmp, /usr/adm/wtmp, /etc/ttys, /etc/rc SEE ALSO
login(1), kill(1), sh(1), ttys(5), crash(8), getty(8), rc(8), reboot(8), halt(8), shutdown(8) 4th Berkeley Distribution November 27, 1996 INIT(8)
All times are GMT -4. The time now is 03:16 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy