=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
UNIX GURU UNIVERSE
UNIX HOT TIP
Unix Tip 3268 - January 20, 2016
http://www.ugu.com/sui/ugu/show?tip.today
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
RUN DAILY WITH AT
UNIX provides a command called "at"
which can be used to run jobs according
to the specfied time.
To run a particular job in every hour,
every day use the following set of
commands in a file called "at.sh" which
will be executed recursively everyday.
########### CUT HERE ##################
#! /usr/bin/sh
# dt is a variable used to store
# current date
dt=`date | cut -c5-10`
# tm is a variable used to store
# current time
tm=`date | cut -c12-13`
while [ $tm -le 23 ]
do
# "at" is the command ad -f is the
# option used to execute a specified
# file. "file Name" should be an
# executable file.
at -f ./"file Name" $tm $dt
tm=`expr $tm + 1`
done
# With out manual intervention, automatic
# change over to the next day's job
# scheduling
at -f ./"File Name" 2358 $dt
dt=`expr $dt + 1`
at -f ./at.sh 0002 $dt
########### CUT HERE ##################
--------------------------------------------------------------------------
To Subscribe: http://www.ugu.com/sui/ugu/show?tip.subscribe
To Unsubscribe: http://www.ugu.com/sui/ugu/show?tip.unsubscribe
To Submit A Tip: http://www.ugu.com/sui/ugu/show?tip.today
==========================================================================
DISCLAIMER: All UNIX HOT TIPS ARE OWNED BY THE UNIX GURU UNIVERSE AND ARE
NOT TO BE SOLD, PRINTED OR USED WITHOUT THE WRITTEN CONSENT OF THE UNIX
GURU UNIVERSE. ALL TIPS ARE "USE AT YOUR OWN RISK". UGU ADVISES THAT
ALL TIPS BE TESTED IN A NON-PRODUCTION DEVELOPMENT ENVIRONMENT FIRST.
Unix Guru Universe - www.ugu.com - tips@ugu.com - Copyright 1994-2001
==========================================================================
Rabu, 20 Januari 2016
Langganan:
Posting Komentar (Atom)
Tidak ada komentar:
Posting Komentar