Main script triggers second and it has to run at specific interval


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Main script triggers second and it has to run at specific interval
# 1  
Old 05-14-2012
Main script triggers second and it has to run at specific interval

Hi Friends,
I am newbie to shell programming and I am stuck trying to accomplish following task.We use Bamboo CI which executes script1 passing parameters. This Main script executes script2 as backend process as part of one of it statements. Task of script2 is to essentially check whether a particular site is up and running, once it is up has to execute sequence of steps.
I implemented this using

script2.sh:
curl url -o test.page
count = cat test.page | grep copyrights |wc -l
if (count -gt 0); then
execute statements.
else
script2.sh $args & sleep 10

Now the problem is , even though I am calling it after 10 secs. It does not seem to execute.

Can someone direct me please?

Thanks in advance
Aditya
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

A function that refuses to run anywhere else but main()

Hi. I have some code, that for some reason, I could not post it here in this post. Here's the address for it: #if 0 shc Version 4.0.1, Generic Shell Script Compiler GNU GPL Version 3 Md - Pastebin.com First off, I used "shc" to convert the code from shell script to C. And The... (6 Replies)
Discussion started by: ignatius
6 Replies

2. Shell Programming and Scripting

How to send mail at specific calculated time interval?

Hi All, I want to send an email if the time difference from previous mail sent is more than or equal to 30 mins. I have written below code and it's working fine. In this script I am storing previous mail sent time in txt file. Instead of storing in txt file how to store in a variable.... (8 Replies)
Discussion started by: nalu
8 Replies

3. Shell Programming and Scripting

Run Bash Script thrice & then interval for 10 mins.

Hi... I am very new to shell scripting. I have written a script with help of this forum and some googling and it works the way I want it to. Currently this script checks for my SIP trunk registration every 5 seconds, if registration is not available then it reboots my router through telnet... (4 Replies)
Discussion started by: jeetz
4 Replies

4. UNIX for Dummies Questions & Answers

Script does not run from a user specific cronjob.

Hello, I have two crontabs, one for the root and one for another user. There is a script in my configurations that has to send a email. The script works and sends the emails when I run it by hand with either the root or the user, and when I program it in the root's crontab. But! It does not... (3 Replies)
Discussion started by: Tralaraloro
3 Replies

5. Shell Programming and Scripting

shell script that will run for a specific date

Hi, I have these changes needed to modify a shell script that will run on a specific date of a month, below pseudocode, appreciate any answers..thanks.. if date of the month is 26th then ..event 1 fi if date of the month is 26th and month are MAR,JUN,SEP,DEC then ..event2 ... (7 Replies)
Discussion started by: sonja
7 Replies

6. Shell Programming and Scripting

How to run a script everyday between 7 and 8 pm with the time interval of 5 minutes?

Hi, Can someone help me in running a cronjob everyday between 7 and 8 pm with the time interval of 5 minutes in between to repeat that script. The script is so small and I need that to run daily between this time. Please if possible provide me the syntax for this logic. Thanks. (4 Replies)
Discussion started by: cya
4 Replies

7. UNIX for Dummies Questions & Answers

Run script in the background with a time interval

I have a script I want to run in the background, and I have looked it up but I am not exactly sure how to do. First of all to run it in the background do you have to put something in the script or is it just a command when you go to run it. I found this solution to it but once again I am not to... (2 Replies)
Discussion started by: mauler123
2 Replies

8. Shell Programming and Scripting

run script 1 minute interval without CronTab

I am using Solaris 9. I wish to run my script every 1 minute inteval. Though i can run it using below entry in crontab. * * * * /export/home/username/script/file_exist_&_run.sh in short above script will check whether a specific file exist in a directory. If it found it will inovke another... (10 Replies)
Discussion started by: thepurple
10 Replies

9. Shell Programming and Scripting

script to run repeatedly after a fixed interval of time

Hi , I am working on the following script . I want this script to run and scan the log file repeatedly after 3 hours. This script will run & scan just for the current date logs and after every 3 hours. Kindly advice what to add in this script for this purpose. #!/bin/sh diff common.log... (3 Replies)
Discussion started by: himvat
3 Replies

10. Shell Programming and Scripting

Shell Script Run Interval to be dynamic

Hi All. I have a script which has to be run periodically. The frequency of its run will be decided by a Database stored value PollRate. e.g. If PollRate value is 300secs, then the script should be executed every 5 minutes, if it's 1500secs, it should execute every 15 minutes. Is there... (5 Replies)
Discussion started by: rahulrathod
5 Replies
Login or Register to Ask a Question
NPM-RUN-SCRIPT(1)                                                                                                                NPM-RUN-SCRIPT(1)

NAME
npm-run-script - Run arbitrary package scripts SYNOPSIS
npm run-script <command> [--silent] [-- <args>...] alias: npm run DESCRIPTION
This runs an arbitrary command from a package's "scripts" object. If no "command" is provided, it will list the available scripts. run[-script] is used by the test, start, restart, and stop commands, but can be called directly, as well. When the scripts in the package are printed out, they're separated into lifecycle (test, start, restart) and directly-run scripts. As of ` https://blog.npmjs.org/post/98131109725/npm-2-0-0, you can use custom arguments when executing scripts. The special option -- is used by getopt https://goo.gl/KxMmtG to delimit the end of the options. npm will pass all the arguments after the -- directly to your script: npm run test -- --grep="pattern" The arguments will only be passed to the script specified after npm run and not to any pre or post script. The env script is a special built-in command that can be used to list environment variables that will be available to the script at run- time. If an "env" command is defined in your package, it will take precedence over the built-in. In addition to the shell's pre-existing PATH, npm run adds node_modules/.bin to the PATH provided to scripts. Any binaries provided by locally-installed dependencies can be used without the node_modules/.bin prefix. For example, if there is a devDependency on tap in your package, you should write: "scripts": {"test": "tap test/*.js"} instead of "scripts": {"test": "node_modules/.bin/tap test/*.js"} to run your tests. The actual shell your script is run within is platform dependent. By default, on Unix-like systems it is the /bin/sh command, on Windows it is the cmd.exe. The actual shell referred to by /bin/sh also depends on the system. As of ` https://github.com/npm/npm/releases/tag/v5.1.0 you can customize the shell with the script-shell configuration. Scripts are run from the root of the module, regardless of what your current working directory is when you call npm run. If you want your script to use different behavior based on what subdirectory you're in, you can use the INIT_CWD environment variable, which holds the full path you were in when you ran npm run. npm run sets the NODE environment variable to the node executable with which npm is executed. Also, if the --scripts-prepend-node-path is passed, the directory within which node resides is added to the PATH. If --scripts-prepend-node-path=auto is passed (which has been the default in npm v3), this is only performed when that node executable is not found in the PATH. If you try to run a script without having a node_modules directory and it fails, you will be given a warning to run npm install, just in case you've forgotten. You can use the --silent flag to prevent showing npm ERR! output on error. You can use the --if-present flag to avoid exiting with a non-zero exit code when the script is undefined. This lets you run potentially undefined scripts without breaking the execution chain. SEE ALSO
o npm help 7 scripts o npm help test o npm help start o npm help restart o npm help stop o npm help 7 config January 2019 NPM-RUN-SCRIPT(1)