Sponsored Content
Full Discussion: Parameters in crontab
Top Forums UNIX for Beginners Questions & Answers Parameters in crontab Post 302989155 by chakrapani on Monday 9th of January 2017 08:27:57 AM
Old 01-09-2017
Some of the things

Quote:
shell script which send an alert if a particular script scheduled in cron is not triggered.
  1. Did you check with cron logs?
    $ tail /var/log/cron
  2. What is the exit code of your script ? (pseudo code below)
    0 0 * * * (./script_waits_4hrs_then_fails.sh ) && ( mail -s "Success" ) || ( mail -s "Failed")
  3. May be modify the script to be more proactive and report to you before it decide to fail. ( Provide the script, we can suggest on certain "pro-activeness" for script. )
  4. If your don't want to modify the script then write another script to monitor the file and logs after the file downloaded is processed.
    Around the lines
    1. Check every X mins interval if file is available at "upstream" ? in four hours of time.
    2. If file appears then check if "script" writes any logs etc. If there is some activity, we have file and it started processed.
    3. Another way is to check for any process that the script is suppose to call example database call or other connections. Any binaries etc ..


Hope you get your answer and share your solution.

---------- Post updated at 08:27 AM ---------- Previous update was at 08:21 AM ----------

Also if your script does give out good output and if there are not many in cron jobs. Many be adding MAIL to will get you output of script. Make sure Mail server setup is good.
Code:
MAILTO=me@domain.com


Last edited by rbatte1; 01-09-2017 at 09:35 AM.. Reason: Converted textual numbered lists into formatted numbered lists
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need Parameters Help.

I can test for one parameter but anything more then that and I get an Error. I forgot I run this batch in a shell #!/bin/sh ------------------------------------------------------------------------- Write a batch program that accepts a keyword as a parameter and finds all the files... (3 Replies)
Discussion started by: james2006
3 Replies

2. Shell Programming and Scripting

parameters

I have a script that needs to check if the given parameters are a combination of 0123456789 and not a word or another irelevant character.please help (6 Replies)
Discussion started by: aekaramg20
6 Replies

3. Shell Programming and Scripting

Parameters in loop

Hi, I am trying to write a script which will read inputs form user and process those files, I have issue reading the input parameters in a loop. Following is the script... I run the script as ./Script.sh 3 table1 table 2 table3 NumberOfTables=$1 let TableCount=1 while do ... (3 Replies)
Discussion started by: mgirinath
3 Replies

4. Shell Programming and Scripting

parameters

i'm supposed to come up with a script that -accepts a directory as an optional command line parameter -display an error message and terminates if more than one parameter is provided -use the current directory if no parameter is provided -displays an error message and terminates if the provided... (4 Replies)
Discussion started by: jaay
4 Replies

5. Shell Programming and Scripting

More than nine parameters

Hi, please tell me the systax for passing 11 variables(including 4compulsory variables) in shell program. ORA_USERPASS=`echo $1` USERID=`echo $2` USERNAME=`echo $3` REQUESTID=`echo $4` P5=`echo $5` P6=`echo $6` P7=`echo $7` P8=`echo $8` P9=`echo $9` shift P10=`echo $9` shift... (3 Replies)
Discussion started by: anitha126
3 Replies

6. AIX

tuning network parameters : parameters not persist after reboot

Hello, On Aix 5.2, we changed the parameters tcp_keepinit, tcp_keepintvl and tcp_keepidle with the no command. tunrestore -R is present in inittab in the directory /etc/tunables we can clearly see the inclusion of parameters during reboot, including the file lastboot.log ... (0 Replies)
Discussion started by: dantares
0 Replies

7. Shell Programming and Scripting

Getting parameters

Hi, I have 2 scripts one master.sh and child.sh. The master runs on a separate server and pushes the child script to the desginated server and runs it.The child script configures the designated server for our day to day use and it has lot of interactive questions which help the... (4 Replies)
Discussion started by: a12ka4
4 Replies

8. Shell Programming and Scripting

Passing Parameters to Crontab

Hello Experts, I have a requirement to pass some parameters to Linux cron tab. For ex: My default cron entry looks like this as below: ------------------------------- 55 10 * * --... (7 Replies)
Discussion started by: MaheshChaudhari
7 Replies

9. UNIX for Dummies Questions & Answers

Crontab not processing parameters sent to script.

Hello All, I'm running Debian on a ThinkPad X1/2G and all seems to be running well. However, it's got a SSD that needs the trim command run at regular intervals. I'm implementing this using cron and a shell script, as recommended. The cron job entries are as follow: 0 * * * *... (8 Replies)
Discussion started by: ASGR
8 Replies

10. AIX

Input parameters

friends and I can validate whether to run the shell has input parameters m event date, I occasionally happen something like this does not work if $ 1 is null then echo has entered input parameters else echo "parameter ok" fi (2 Replies)
Discussion started by: tricampeon81
2 Replies
uudemon(4)						     Kernel Interfaces Manual							uudemon(4)

NAME
uudemon.admin, uudemon.cleanu, uudemon.hour, uudemon.poll - Administrative shell scripts for polling remote systems, cleaning up spool directories, reporting status to the system administrator, and routine invocations of the uuxqt and uusched daemons SYNOPSIS
These shell scripts reside in the following directory: /usr/lib/uucp DESCRIPTION
All the scripts can be run from the command line or can be run automatically by the cron daemon. To automatically run the scripts, remove the comment character (#) from the beginning of the relevant line in the /var/spool/cron/crontabs/uucp file. This script reports status to the system administrator. It issues the uustat command to find out the status of uucp jobs. It mails the results to the uucp login ID. The script may be modified to send mail to any login ID such as the uucp administrative login ID (uucpa) or root. This script cleans up the /var/spool/uucp and /var/spool/uucppublic directories by running the uucleanup command. The uucleanup com- mand is run with the following parameters: -C7, -D7, X2, -o2, -W1. This script runs the uusched and uuxqt daemons in the background. This script polls the systems listed in the /usr/lib/uucp/Poll file. The uudemon.poll script should be scheduled before the uudemon.hour script. This allows uudemon.poll to create any command files before cron runs the uudemon.hour script. FILES
Contains the uudemon.admin, uudemon.cleanu, uudemon.hour and uudemon.poll files. Contains the uucp file. RELATED INFORMATION
Commands: cron(8), uucleanup(8), uusched(8), uuxqt(1) Files: /usr/lib/uucp delim off uudemon(4)
All times are GMT -4. The time now is 11:35 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy