07-30-2007
I am not sure..
try executing the command with full path
/bin/ls -lt | tail -1 | awk '{print $6}' >> /tmp/ramb.out
10 More Discussions You Might Find Interesting
1. Solaris
Anyone know
How to configure solaris 8 to display hostname in command prompt , everytime when you open a terminal screen . (3 Replies)
Discussion started by: civic2005
3 Replies
2. Shell Programming and Scripting
Hi All,
The script which i am using to SSH to remote server is working fine when i run is using ./ but when cron runs it it gives error that "ssh: not found"
please help!!! (3 Replies)
Discussion started by: visingha
3 Replies
3. Shell Programming and Scripting
Hello,
I have written a script that has a sudo command to change file permissions within it.
When I run the script manually, the sudo command inside of it works fine.
When the script is run through crontab I get the error "cron: not found".
It the same user profile that I am using... (6 Replies)
Discussion started by: WhotheWhat
6 Replies
4. Shell Programming and Scripting
cron job not running the sqlplus command in shell script but the shell script works fine from command line..
Cronjob:
5 * * * * /home/dreg/script.sh
script.sh:
#!/bin/ksh
/oracle/u000/app/oracle/product/10204/GEN/bin/sqlplus -s <user>/<pass>@<sid/home/dreg/sqlscript.sh
... (18 Replies)
Discussion started by: Ikea
18 Replies
5. UNIX for Dummies Questions & Answers
I would like to setup a cron job to run a command from another directory.
What is the best way to do this?
The cron file is in a directory and the script I want it to run is in another directory.
I tried doing this in the cron file:
/location/of/command/run.sh
But that did not work.... (2 Replies)
Discussion started by: Sepia
2 Replies
6. Shell Programming and Scripting
Hi,
I have an autosys box job and 2 command jobs. When i force start the box job the command jobs are moving to 'Active' state but are not running. I have tried various options for the start times and run windows but doesnt seem to work. Any help is appreciated
update_job: job1.jil... (1 Reply)
Discussion started by: userscript
1 Replies
7. Shell Programming and Scripting
HI,
I have a problem with 'sar' command.
I am using the sar comman in script.when i execute the script manually using ./filenae, i am getting the desired output.
But when i put the script in cron job i am not getting the desired value.
Below is the script..
sar > $_LOCATION/sar.txt... (2 Replies)
Discussion started by: ahamed
2 Replies
8. Shell Programming and Scripting
Hi, I have a simple script. When I run it as cron job. I jot email saying:
/bin/sh: line 1: test.tmp: command not found.
the test.tmp looks like:
#!/bin/sh
date > done
Even I took first line out, I got the same error.
The current shell I have is /bin/tcsh
Could anyone help me... (2 Replies)
Discussion started by: natxie
2 Replies
9. Shell Programming and Scripting
Hi
I have one problem with cron job in Control Panel.
I have a log file that is created once a day on another server and I need to transfer it in an exact time to my server so I wrote the cron job for it BUT the problem is in the date command:
/filelog-`date +%Y-%m-%d`.tar.gz;
The file... (1 Reply)
Discussion started by: bobo_balde
1 Replies
10. Shell Programming and Scripting
Hi,
I created this cron job for asterisk to send sms daily to a number
#!/bin/sh
#custom mod - send sms once a day, at 07:00.
CRON_PATH="/etc/asterisk/gw/crontabs_root";
if ! grep 'gsm send sms' $CRON_PATH > /dev/null 2>&1 ;then
echo "* 7 * * * asterisk -rx 'gsm send sms 1 7666... (4 Replies)
Discussion started by: jazzyzha
4 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)