|
|
ru.linux- RU.LINUX --------------------------------------------------------------------- From : Pavel Vasilyev 2:5020/2132.43 11 Mar 2003 02:40:46 To : All Subject : Unix Tip: RUN DAILY WITH AT --------------------------------------------------------------------------------
* Это письмо переслал Pavel Vasilyev (2:5020/2132.43)
* Из эхи : NETMAIL (Netmail)
* Автор : listserv@ugu.com, 2:5020/128 (10 мар 03 г., 21:46)
* Адресат : pavel vasilyev
* Тема : Unix Tip: RUN DAILY WITH AT
=============================================================================
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
UNIX GURU UNIVERSE
UNIX HOT TIP
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
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 ##################
Прикольчик !
С уважением, Pavel 11 мар 03 года
--- GoldED+/LNX 1.1.5-30120
* Origin: Aut caesar, aut nihil. (2:5020/2132.43)
Вернуться к списку тем, сортированных по: возрастание даты уменьшение даты тема автор
Архивное /ru.linux/45243e6d14b9.html, оценка из 5, голосов 10
|