Sponsored Content
Top Forums Shell Programming and Scripting use crontab for a shell script.. Post 302596733 by gauravah on Wednesday 8th of February 2012 07:07:45 AM
Old 02-08-2012
Java use crontab for a shell script..

hi,

i have shell script which checks for service running on platform,
if service is receiving calls, then do nothing
if service is not receiving calls, then stop the service

i want to run this script in 2 timeslots.
i.e. in the day from 9 am to 5 pm it should run every 10 minutes

and
from 5 pm to next morning 9 am , it should run every 1 hour

can i schedule the running of script using crontab this way?

kindly provide inputs

thanks in advance
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to remove line from crontab in shell script?

Hi folks, I need to write a rollback script which removes the following line from the crontab: 0 0 * * * su - orca -c "/home/orca/core-<SCHEMA_NAME>/cleanup/CLI/cleanup_BRMS.ksh -c OC4J_RiGHTv_<SCHEMA_NAME>" <SCHEMA_NAME> is parameter. How to do it in ksh? Maybe it's better to backup the... (2 Replies)
Discussion started by: nir_s
2 Replies

2. UNIX for Dummies Questions & Answers

how to execute sh script in bash shell via crontab

hello. we are porting over from HPUX Shell to Linux. my default shell is bash so i can no longer schedule to execute a sh script in crontab. can anyone pls help me out? I searched the site but didnt find any details. thanks! (1 Reply)
Discussion started by: jigarlakhani
1 Replies

3. Shell Programming and Scripting

crontab entry modification using shell script

hi Friends, iam trying to write a script which will grep the particular entry in crontab of root and enable/disable it .iam a novice in scripting. your suggestions are most welcome..please help Cheers!! (4 Replies)
Discussion started by: munishdh
4 Replies

4. Shell Programming and Scripting

How do i run a shell script without crontab.

Hi Folks, Could you please suggest me how to run a shell script on a solaris env without using crontab. I am actually trying to write a shell script which will grep "WORD" in the logfile andd sends a email.Thanks in advance. Thanks Sandeep. (3 Replies)
Discussion started by: sandeep anand
3 Replies

5. Shell Programming and Scripting

Can we edit crontab using a shell script

Hi, Can some one tell me if we can configure the jobs in crontab using a shell script. I know it can be done easily by using "crontab -e", but i just want to know whether we can add a job into the crontab using a shell script. If it can be done, plz suggest the procedure to do it. If it... (6 Replies)
Discussion started by: rudrarajumk
6 Replies

6. Shell Programming and Scripting

Change crontab from shell script

Hi All, I have scheduled a script to run every five minutes through crontab. If there is any issue with the script which may need manual intervention, I have used the mailx commands. But at the same time, I would want the cron to be disabled until the issue is resolved. Once things are fine,... (2 Replies)
Discussion started by: adi_2_chaos
2 Replies

7. Shell Programming and Scripting

Wants to change shell script into crontab

Hi friends, Actually i wrote many scripts in korn shell for time saving activity in storage domain. But every week i am spending some time for the running of script. So every Monday i wants to run my scripts automatically. So corn will be helpful according to my friend's opinion. But I don't... (5 Replies)
Discussion started by: Mahendranath
5 Replies

8. Shell Programming and Scripting

crontab using shell script to sync files.

Hi, I developed one shell script where it will sync the files using perforce, #!/bin/bash TERM=linux export TERM clear echo "" $PATH echo "" cd /u/userk/p4/p4_client/TES_DATE echo "" echo "Sync p4 " p4 sync echo "Executing for second time " p4 -u userk -p p4net:161 -c... (8 Replies)
Discussion started by: asak
8 Replies

9. Shell Programming and Scripting

Issue in running shell script in crontab

I'm having a shell script which has to be run only once at the specified time. Shell script is like following, #!/bin/bash db2 connect to XXX > connection_status.txt This script is scheduled in crontab as following, 50 4 8 5 0 sh script.sh scheduled script is run at the specified time... (1 Reply)
Discussion started by: Rajkumar Gandhi
1 Replies

10. Shell Programming and Scripting

Schedule a shell script without crontab every Wednesday at 10 AM

HI Guys I need one shell script to be scheduled to run one shell script to be executed automatically every Wednesday at 10 AM Without crontab and "at" command.. Could you provide your suggestions ? Thanks and Regards kshitij Kulshreshtha (6 Replies)
Discussion started by: kshitij
6 Replies
SERVICE(8)                                                    System Manager's Manual                                                   SERVICE(8)

NAME
service - run a System V init script SYNOPSIS
service SCRIPT COMMAND [OPTIONS] service --status-all service --help | -h | --version DESCRIPTION
service runs a System V init script or systemd unit in as predictable an environment as possible, removing most environment variables and with the current working directory set to /. The SCRIPT parameter specifies a System V init script, located in /etc/init.d/SCRIPT, or the name of a systemd unit. The existence of a systemd unit of the same name as a script in /etc/init.d will cause the unit to take precedence over the init.d script. The supported val- ues of COMMAND depend on the invoked script. service passes COMMAND and OPTIONS to the init script unmodified. For systemd units, start, stop, status, and reload are passed through to their systemctl/initctl equivalents. All scripts should support at least the start and stop commands. As a special case, if COMMAND is --full-restart, the script is run twice, first with the stop command, then with the start command. service --status-all runs all init scripts, in alphabetical order, with the status command. The status is [ + ] for running services, [ - ] for stopped services and [ ? ] for services without a status command. This option only calls status for sysvinit jobs. EXIT CODES
service calls the init script and returns the status returned by it. FILES
/etc/init.d The directory containing System V init scripts. /{lib,run,etc}/systemd/system The directories containing systemd units. ENVIRONMENT
LANG, LANGUAGE, LC_CTYPE, LC_NUMERIC, LC_TIME, LC_COLLATE, LC_MONETARY, LC_MESSAGES, LC_PAPER, LC_NAME, LC_ADDRESS, LC_TELEPHONE, LC_MEA- SUREMENT, LC_IDENTIFICATION, LC_ALL, TERM, PATH The only environment variables passed to the init scripts. SEE ALSO
/etc/init.d/skeleton update-rc.d(8) init(8) invoke-rc.d(8) systemctl(1) AUTHOR
Miloslav Trmac <mitr@redhat.com>, Petter Reinholdtsen <pere@hungry.com> Licence: GNU Public Licence v2 (GPLv2) COPYRIGHT
2006 Red Hat, Inc., Petter Reinholdtsen <pere@hungry.com> Jan 206 SERVICE(8)
All times are GMT -4. The time now is 12:43 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy