Sponsored Content
Top Forums Shell Programming and Scripting How to determine if a script (perl) was called from a CRON job or commandline Post 302069027 by jerryMcguire on Wednesday 22nd of March 2006 07:33:57 AM
Old 03-22-2006
How to determine if a script (perl) was called from a CRON job or commandline

Hi,

Is there a way to determine if a Script is called from a
CRON job or from a commandline

Gerry.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

gzip in shell script called by cron

I'm puzzled by this one. I hope you can explain it to me. I have a ksh shell script that gzips a file among other things. This works perfectly fine when the script is manually run through a shell. However, when the same script is run through cron, it does everything correctly, but it will... (2 Replies)
Discussion started by: hbau419
2 Replies

2. Shell Programming and Scripting

How to determine the script is called from CRON?

Hello expert, What I want is to determine whether the script is called from CRON or it is executed interactively? I tried the following but no luck: #!/bin/ksh cronID=`pgrep -x cron` GPID=`ps -ef -o ppid,pid | grep " $PPID$" | awk '{print $1}'` if ; then echo I am being run... (15 Replies)
Discussion started by: wes_brooks
15 Replies

3. UNIX for Advanced & Expert Users

Cron job for Perl script

Although there are many threads on this forum regarding cron, none have specifically answered my question. So hopefully someone can shed some light on what I'm doing wrong.. I have a perl script that I want to run in a cron job. Since I've read that cron doesn't have any environments set, I... (3 Replies)
Discussion started by: man
3 Replies

4. UNIX for Dummies Questions & Answers

a cron job needs a perl script to execute

Hello evreyone, this is my first post, and to say i'm new to this is an understatement. I know very little about perl scripts and hope some one can help me. i'm looking to get a script that a cron job can execute. what the script needs to to is 1) connect to a mysql database 2) go to a... (2 Replies)
Discussion started by: Exader
2 Replies

5. Shell Programming and Scripting

autosys job name in the called script

Hi, i have an autosys job 'AUTJOBA' that calls a script script1.sh Now, inside the script i would like to know the autosys job that kicked off this script. When AUTJOBA runs script1.sh, will it set an environmental variable for this shell session that can be accessed within this script? ... (1 Reply)
Discussion started by: ysrinu
1 Replies

6. Shell Programming and Scripting

Script not working when called by cron

Hello, I have the following script which works fine when ran from the command line: #!/apps/python/2.3.4/bin/python import os import sys import time user = os.getenv("USER") string = time.strftime("%m%d%y0000 " + user, time.gmtime()) However, when I have this run by crontab, I... (4 Replies)
Discussion started by: cooldude
4 Replies

7. Shell Programming and Scripting

get system date, format it, pass it as a parameter to a perl script - all in cron job

I am trying to get the string containing date - in a specfic format actually, although I think that part is inconsequencial - 1110226^1110226^1110226^1110226^1110226 - through echo or printf or in some other way - created within a cront job and passed as a parameter to a perl script. Now, I know... (3 Replies)
Discussion started by: v8625
3 Replies

8. UNIX for Dummies Questions & Answers

Interpreting Shell Script errors when called from CRON

Hi All, I am calling a series of shell scripts via CRON so everything is running as root. However, in my error log file I am seeing the following errors. Please can anyone offer any advise as to the possible causes and solution to prevent the errors from appearing. The Error 1227 seems to... (2 Replies)
Discussion started by: daveu7
2 Replies

9. Shell Programming and Scripting

Shell script not getting called through cron job but executes fine manually.

Hi, My shell script not getting called through cron job. The same works fine when executed manually. I tried to generate logs to find if the scripts has some errors related to path using following command- trying to execute .sh file every 5 mins: */5 * * * * /home/myfolder/abc.sh... (17 Replies)
Discussion started by: Dejavu20
17 Replies

10. Shell Programming and Scripting

Script executed by Cron or commandline

Hello all, I have a question regarding the difference betwen cron and command line. What I would like to do is to print a statement into a logfile if a script has been executed from cron or from command line. It should be as: #!/bin/bash if <Check if this script has been... (3 Replies)
Discussion started by: API
3 Replies
CAPISUITEFAX(1) 														   CAPISUITEFAX(1)

NAME
capisuitefax - sending faxes with the CapiSuite default scripts SYNOPSIS
capisuitefax [-q] [-n] [-u user] [-A adr] [-S subj] -d number file... capisuitefax [-q] -a id capisuitefax -h capisuitefax -l DESCRIPTION
The default scripts for CapiSuite come with the tool capisuitefax for sending faxes. It will be called with some parameters telling it which file to send (it currently only supports PostScript and PDF files) and to which number. It will then enqueue the job converted to the right format into the send queue from which it's collected by another CapiSuite script and sent to the destination. If the sending was completed successfully or failed finally after trying for some time, the according user will get an email telling him/her what has happened. OPTIONS
-a id Abort the job with the given id. To get a job id, use the -l option. -A adr The addressee of the fax. This option is (currently) only for informational purposes and will be quoted in the sent status mail. -d number The number which should be called (destination of the fax) -h Show a short commandline help -l Shows the jobs which are currently in the send queue. -n Don't use the configured dial prefix for this job. Useful for internal jobs. -q Be quiet, don't output informational messages -S subj A subject for the fax. This option is (currently) only for informational purposes and will be quoted in the sent status mail. -u user Send fax as another user. Only allowed if capisuitefax is called as user root. This is mainly helpful for realizing extensions to e.g. do network faxing. file... One or more PostScript/PDF files to send to this destination. More than one PostScript file will produce several separate fax jobs. SEE ALSO
capisuite(8), capisuite.conf(5), fax.conf(5), answering_machine.conf(5) AUTHOR
Gernot Hillier <gernot@hillier.de>. CAPISUITEFAX(1)
All times are GMT -4. The time now is 04:56 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy