I have a bash script which is scheduled to run for every 20 minutes. Inside the bash script, one command which I am using need to be triggered only once in two or three hours.Is there anyway to achieve this.
For example,
In most cases file will not be there, so it will go to else portion and execute hello.. But this one I need to execute only once in 3 hours, instead of executing it every 20 minutes
I want to schedule a batch job (SQL)to run every 6 hours in Unix and the AT command syntax does not seem to cover this.
I have created a file ncd_rpt in the directory report and have given the command in this file.
at -f /report/ncd_rpt 1:00 am tomorrow
I schedule this by running
sh... (1 Reply)
Hi Folks,
I need to remove log files for six hours on Solaris. before i used to do for every 24 hours below is the code for 1 day older log files, now i tried using -mmin +360 but it says command not found.
Can someone please help me out!!!
part of the code:
LOG_FILE=`find /home/Logdir... (1 Reply)
Hi All
I have a problem, I wonder if you can help me sort it out:
I have the following entry in the cron:
00 1,13 * * * /home/report/opn_amt_gestores_credito.ksh > opn_amt_gestores_credito.log
But the entry only runs at 01:07
I have stopped the cron deamon, and started, but it still... (39 Replies)
Hi All,
new to the forum and new to Unix but I have an issue which is annoying on a new level. I have included a short and full version for anyone needing more information.
Short Version
I am running a set of scripts that work and run fine. one of the scripts arranges the first... (4 Replies)
Hi
I need to setuop a cron entry to run every 5 min, only in office hours (between 8:00AM to 18:00PM, I did the following:
0,5,10,15,20,25,30,35,40,45,50,55 8,9,10,11,12,13,14,15,16,17,18 * * * /home/xxx/zzz.ksh
But somehow does not work.
Could it be wrong? (8 Replies)
Hi,
I've written a ksh script that read a file and parse/filter/format each line. The script runs as expected but it runs for 24+ hours for a file that has 2million lines. And sometimes, the input file has 10million lines which means it can be running for more than 2 days and still not finish.... (9 Replies)
Discussion started by: newbie_01
9 Replies
LEARN ABOUT ULTRIX
at
at(1) General Commands Manual at(1)Name
at, batch - execute commands at a later time
Syntax
at time [day] [file]
at -r job...
at -l [job...]
batch [file]
Description
The and commands use a copy of the named file (standard input default) as input to or at a later time. A command to the current directory
is inserted at the beginning, followed by assignments to all environment variables. When the script is run, it uses the user and group ID
of the creator of the copy file.
The command allows the user to specify when the commands should be executed, while jobs queued with execute when the load level of the sys-
tem permits.
The environment variables, current directory, and are retained when the commands are executed. However, open files, traps, and priority
are lost.
Users are permitted to use the and commands if their name appears in the file If that file does not exist, the file is checked to determine
if the user should be denied access to and If neither file exists, only the superuser is allowed to submit a job. If only the file exists
and is empty, global usage is permitted. The files consist of one user name per line.
The time is 1 to 4 digits. It can, but does not have to be, followed by A, P, N or M which stand for AM, PM, noon or midnight, respec-
tively. The A, P, N, and M suffixes are case-insensitive. One and two digit numbers are interpreted as hours, three and four digits to be
hours and minutes. If three digits are specified, the first digit is interpreted to be an hour in the range 0-9, and the second and third
digits as minutes. If no letters follow the digits, a 24 hour clock time is presumed.
In addition to 1-4 digits, and suffixes A, P, M, N, you can also specify:
at hh:mm
at h:mm
at ham
at hpm
at noon
at midnight
The optional day is either a month name followed by a day number or by a day of the week. If the word week follows, the or command is
invoked in seven days. Both commands also recognize standard abbreviations for the days of the week and months of the year. The following
are examples of legitimate commands:
at 8am jan 24
at 1530 fr week
The programs are executed by periodic execution of the command from The granularity of depends upon how often atrun is executed. The com-
mand examines the file every minute. The file determines when is executed. The default is every 15 minutes on the 1/4 hour. Editing makes
run more or less frequently.
Standard output or error output is lost unless it is redirected.
The and commands write the job number to standard error.
Options-r Removes jobs previously scheduled by or The number is the number reported at invocation by or Only the superuser is
allowed to remove another user's jobs.
-l Lists all job numbers for all jobs submitted by the user issuing the command. Even if the user is "root", only numbers
for jobs submitted by "root" are displayed. To see the numbers of all jobs submitted, enter the following command:
% ls -l /usr/spool/at
Restrictions
Due to the granularity of the execution of there may be bugs in scheduling jobs almost exactly 24 hours into the future.
Diagnostics
Complains about various syntax errors and times that are out of range.
Files
/usr/lib/atrun executor run by cron(8)
in /usr/spool/at:
yy.ddd.hhhh.* activity for year yy, day dd, hour hhhh.
lasttimedone last hhhh
past activities in progress
/usr/spool/at/at.allowlist of allowed users
/usr/spool/at/at.denylist of denied users
/usr/spool/at spool directory
/usr/lib/cron XOPEN compatibility
See Alsocrontab(5), cron(8)at(1)