Script Variables Inquiry, Values Okay in Standalone Exec, No-Show in Cron Exec
I have the following bash script lines in a file named test.sh.
When I execute ./test.sh from the command line, the variables are set and the file name is displayed.
However, when I have the script run through cron, the file name comes back blank. This gives me an indication that the directory listing statement isn't run, possibly. Is this a true observation? What would cause the variables to be set during a standalone execution and not when executed through cron?
Hi everyone,
I've been racking my brains for ages on this and need your help/advice.
I am writing a script that is reading in file to process and putting them into a temporary file. The loop starts and the script gets the first file name, does what i needs to do (copy it) and then returns to... (2 Replies)
I am using a third party job management program called Autosys. the command to load a jil into the autosys database is jil < somefilename.jil
I have a directory and it in are a lot of jils. rather than type jil < somefilename.jil for every file I would like to script something do do it. if cd... (2 Replies)
I am new in Perl.
I am working in simple script and the varibles are working well outside the exec or system command.
but they don't work as parameters to exec or system command.
The script is attached.
please help. (8 Replies)
Hi @ all :)
i made a very little shell script witch is working well when i'm launching it directly
like with ./script
but when i'm launching it by cron tab it work at half only.
the part of the script witch are not working are:
#!/bin/sh
apt-get updade
apt-get -s upgrade >>... (5 Replies)
Hi,
I discovered the following single-line script works very well to cp a large number of files from a source directory to a destination directory while avoiding the "argument list too large" error:
# cpmany - copy large number of files
# Takes two parameters - source dir, destination dir... (14 Replies)
Hi, Gurus,
my script code as following:
#!/usr/bin/sh
mkdir dir1
result=`echo $?`
if ; then
echo "completed"
else
echo "wrong"
fi
When I execute it with command sh filename. , it executed successfully.
but, when I execute it with command . filename it throw out error:
-bash:ELF :... (2 Replies)
Guru's,
I want to make a use of "exec" command in my script and want to check return code of executing script, but as you know exec command will terminate current processID and comeout and will trigger new one, i am unable to check return code of script and not able to run a scrpit after exec. ... (2 Replies)
Hello... And thanks in advance for any help anyone can offer me on my question! I've been doing a lot of reading to try and find my answer... But I haven't had any luck
What I'm trying to understand is where a child process inherits global environment variables from? I understand the exec()... (2 Replies)
Discussion started by: bodisha
2 Replies
LEARN ABOUT CENTOS
anacrontab
ANACRONTAB(5) File Formats ANACRONTAB(5)NAME
/etc/anacrontab - configuration file for Anacron
DESCRIPTION
The /etc/anacrontab configuration file describes the jobs controlled by anacron(8). It can contain three types of lines: job-description
lines, environment assignments, or empty lines.
Job-description lines can have the following format:
period in days delay in minutes job-identifier command
The period in days variable specifies the frequency of execution of a job in days. This variable can be represented by an integer or a
macro (@daily, @weekly, @monthly), where @daily denotes the same value as the integer 1, @weekly the same as 7, and @monthly specifies that
the job is run once a month, independent on the length of the month.
The delay in minutes variable specifies the number of minutes anacron waits, if necessary, before executing a job. This variable is repre-
sented by an integer where 0 means no delay.
The job-identifier variable specifies a unique name of a job which is used in the log files.
The command variable specifies the command to execute. The command can either be a command such as ls /proc >> /tmp/proc or a command to
execute a custom script.
Environment assignment lines can have the following format:
VAR=VALUE
Any spaces around VAR are removed. No spaces around VALUE are allowed (unless you want them to be part of the value). The specified
assignment takes effect from the next line until the end of the file, or to the next assignment of the same variable.
The START_HOURS_RANGE variable defines an interval (in hours) when scheduled jobs can be run. In case this time interval is missed, for
example, due to a power down, then scheduled jobs are not executed that day.
The RANDOM_DELAY variable denotes the maximum number of minutes that will be added to the delay in minutes variable which is specified for
each job. A RANDOM_DELAY set to 12 would therefore add, randomly, between 0 and 12 minutes to the delay in minutes for each job in that
particular anacrontab. When set to 0, no random delay is added.
Empty lines are either blank lines, line containing white spaces only, or lines with white spaces followed by a '#' followed by an arbi-
trary comment.
You can continue a line onto the next line by adding a '' at the end of it.
In case you want to disable Anacron, add the 0anacron cron job (which is a part of crontab(1)) into the /etc/cron.hourly/jobs.deny direc-
tory.
EXAMPLE
This example shows how to set up an Anacron job similar in functionality to /etc/crontab which starts all regular jobs between 6:00 and
8:00 only. A RANDOM_DELAY which can be 30 minutes at the most is specified. Jobs will run serialized in a queue where each job is started
only after the previous one is finished.
# environment variables
SHELL=/bin/sh
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
RANDOM_DELAY=30
# Anacron jobs will start between 6am and 8am.
START_HOURS_RANGE=6-8
# delay will be 5 minutes + RANDOM_DELAY for cron.daily
1 5 cron.daily nice run-parts /etc/cron.daily
7 0 cron.weekly nice run-parts /etc/cron.weekly
@monthly 0 cron.monthly nice run-parts /etc/cron.monthly
SEE ALSO anacron(8), crontab(1)
The Anacron README file.
AUTHOR
Itai Tzur <itzur@actcom.co.il>
Currently maintained by Pascal Hakim <pasc@(debian.org|redellipse.net)>.
For Fedora, maintained by Marcela Malaova <mmaslano@redhat.com>.
cronie 2012-11-22 ANACRONTAB(5)