Sponsored Content
Top Forums Shell Programming and Scripting How to run script automatically every 12 hour once? Post 302810817 by Scott on Wednesday 22nd of May 2013 02:47:10 PM
Old 05-22-2013
If by "every 12 hours once" you mean once every 12 hours, you can run it via cron:
Code:
0 0,12 * * * /path/to/your/script

If you don't discard the output in the script, or in the cronjob, you should receive an email with the output. For more output, perhaps you want to use rm's -v option, depending on how many files you expect to be removed.

You may have to source .profile in the cronjob or in the script.
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to run a script automatically ?????

Hi All, How to run a script automatically using cronjob everyday from Monday to Friday 9A.M to 5P.M at an interval of ONE HOUR.I want the complete syntax means how to put in the cron job and there after. URGENTLY NEED HELP THANKS IN ADVANCE CHEERS Arunava (7 Replies)
Discussion started by: arunava_maity
7 Replies

2. UNIX for Dummies Questions & Answers

how to run a Script automatically

How to make a script run automatically using a cron?? i do not know abt cron...... if i have simple.sh file and i need this to run everyday at a particular time what needs to be done thanks in advance (4 Replies)
Discussion started by: hamsa
4 Replies

3. Shell Programming and Scripting

Run a script on the hour but only for 30mins

Hi All, I want to run a script on the hour during a 24 - hour period; easy enough cron will take care of that..however I want the script to only run for only 30mins.. so with the script it knows its 30mins are up so exits. any ideas? Any help, greatly appericated. Thanking you all... (2 Replies)
Discussion started by: Zak
2 Replies

4. Shell Programming and Scripting

how to run shell script automatically

hi , i m trying to run bash scrip automaticially but i dont know how i can do this an anybody tell me how i can autorun shell script when i logon . thanks (9 Replies)
Discussion started by: tahir23
9 Replies

5. Shell Programming and Scripting

Automatically run bash script

Hi! I want to run/execute a bash script automatically everytime when a specific file is created or when its timestamp changes. Is this possible? How? Thank you very much for your answers in advance, Regards, Christoph (1 Reply)
Discussion started by: ckofler
1 Replies

6. Shell Programming and Scripting

How to run a script automatically

Hi All, How can i run a script every week automatically. Thanks & regards, Sam (5 Replies)
Discussion started by: sam25
5 Replies

7. Shell Programming and Scripting

variable has no value if run the script automatically/scheduled

Hi All, I am using ksh as the shell. I have a script that should store variable after executing "onstat" on informix. I can execute it successfully without any issue if run manually, however the value is not showing up when run automatically(scheduled). Is there anything needed to make the... (1 Reply)
Discussion started by: tungaw2004
1 Replies

8. Shell Programming and Scripting

Shell script to be run every one hour

How can we run shell script every one hour. Anyone having code unit for this? (1 Reply)
Discussion started by: Pratiksha Mehra
1 Replies

9. Shell Programming and Scripting

Run the script continously but mail once in 1 hour

Hi, I have a script written for monitoring the queue manager status continously. below is the script. QMGR=`dspmq | awk '{print $1}' | cut -f2 -d "(" | cut -f1 -d ")"` QMSTATUS=`dspmq | awk '{print $2}' | cut -f2 -d "(" | cut -f1 -d ")"` count=`dspmq | awk '{print $1}' | cut -f2 -d "(" | ... (5 Replies)
Discussion started by: Anusha M
5 Replies
itruns(8)						      System Manager's Manual							 itruns(8)

NAME
itruns - set up files for use by the it command SYNOPSIS
/sbin/itruns file [file...] in run-state [, file [file...] in run-state] [,...] DESCRIPTION
The itruns program sets up scripts to be run by it(8). (These programs are typically used within system configuration and installation scripts.) The itruns command searches for /sbin/it.d/bin/file. If itruns finds the file, it creates one or more symbolic links from /sbin/it.d/run-state.d/file to /sbin/it.d/bin/file. The run-state argument can be a single run state, or it can be two run states separated by either the word or or the word and. If two run states are specified with the or keyword, itruns checks for (and creates, if necessary) a directory whose name combines both run states and places a link in that directory so that the file will be executed when the it program detects either state. You can collapse two or-sepa- rated states into a single expression; for example, 2 or 3 can be expressed as 23. If the and keyword is used, itruns checks for (and cre- ates, if necessary) two separate directories and places a link in each of them so that either state triggers execution of the file indepen- dently of the other state. If two or more files are specified for a single run-state argument, links are created for all of the files as indicated by the run-state argument. If two or more combinations of files and run states are specified as comma-separated expressions, itruns treats each combination individu- ally. RESTRICTIONS
The itruns command must be executed from the root directory (/). The command finds only files that are located in the /sbin/it.d/bin direc- tory. EXAMPLES
This example sets up the doconfig script to be run when the system is booted to run state 2: itruns doconfig in 2 Either of the command lines in this example sets up the doconfig and getdate scripts to be run when the system is booted to run state 2 or to run state 3: itruns doconfig getdate in 2 or 3 itruns doconfig getdate in 23 This example sets up the doconfig script to be run when the system is booted to run state 2 and again when the system comes to run state 3, the getdate script to be run only in run state 2, and the getsysname script to be run only in run state 3: itruns doconfig in 2 and 3, getdate in 2, getsysname in 3 SEE ALSO
Commands: it(8) itruns(8)
All times are GMT -4. The time now is 12:39 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy