Linux with Operating System Concepts



Download 5,65 Mb.
Pdf ko'rish
bet217/254
Sana22.07.2022
Hajmi5,65 Mb.
#840170
1   ...   213   214   215   216   217   218   219   220   ...   254
Bog'liq
Linux-with-Operating-System-Concepts-Fox-Richard-CRC-Press-2014

military notation
. Thus, 
12:00 PM and 12:00 are treated the same but 1:00 PM would be equal to 13:00 and 11:59 PM 
would be indicated as 23:59. For 12:00 AM, the military time is indicated as 0:00. If you use 
AM or PM, you can use either uppercase or lowercase letters. You can also specify the time 
as 
noon

midnight,
and 
teatime
(4 PM).
The date is specified using any one of the following four formats. Each of these is fol-
lowed by an example for November 12, 2013.
• MMDDYY as in 111213
• MM/DD/YY as in 11/12/13
• DD.MM.YY as in 12.11.13
• YYYY-MM-DD as in 2013-11-12
If you do not specify a date, the event is scheduled to take place at the next occurrence 
of the specified time. If it is 3:35 p.m. and you schedule for 14:30 (2:30 PM), then the event 


580

Linux with Operating System Concepts
is scheduled to take place at 2:30 PM of the next day. You can also use the words 
today
or 
tomorrow
for the date, as in 
2:30 PM tomorrow
or 
23:59 today
.
The alternative for the time/date is to specify a time/date relative to the time that the at 
command is submitted. This is specified using the notation: 
now 
+
count unit
, where 
count
is an integer and 
unit
is a temporal unit such as minutes, hours, or days. Here are 
some examples:
• now 
+
5 minutes
• now 
+
2 hours
• now 
+
7 days
• now 
+
4 weeks
You can combine relative and absolute methods but it may not make much sense. For 
instance, 
now 
+
12:00 PM
makes no sense at all but 
now 
+
3 days
would schedule the 
event at the current time in 3 days. Errors in the time/date specification will yield the mes-
sage 
Garbled time
. Note that at schedules events to the minute, not to the second. You 
would never specify the seconds unit for either an absolute or a relative time specification.
The event to be scheduled can be either specified in a separate file or through the com-
mand line. As an example, you have written the activities to be scheduled in the shell script 
my_event.sh
. You would then schedule this using
at 
time/date specifier
–f ./my_event.sh
where 
time/date specifier
is as explained above. The –f option indicates that the event(s) to 
take place is(are) stored in the accompanying file. The file does not have to be a script. It 
could comprise Linux commands or invoke a script.
The alternate approach to specifying the event(s) in a file is to omit the –f option. In this 
case, upon hitting 
<
enter 
>
, you are dropped into an 
at
>
prompt. You now enter your 
commands one line at a time, pressing the 
<
enter 
>
key to end each line. To exit the 
at
>
prompt, press 
control
+
d
. For instance, you might specify
at now 
+
1 minute
Since you did not include –f filename, you now see
at
>
You might then enter
at
>
mount 10.11.12.13:/home/backup/mnt/backup
at
>
tar –xzf /home/* /mnt/backup/home-backup.tar
at
>
umount /mnt/backup
at
>
control
+
d


Maintaining and Troubleshooting Linux

581
Thus, in 1 minute time, you will use tar to create a backup on a mounted file server and 
then unmount the file server when done.
Once events are scheduled, you can examine them using 
atq
. This lists each waiting 
event scheduled through at or batch. You can remove any scheduled item using 
atrm
. If 
there is only one item in the event queue
atrm
will delete it. Otherwise, when you use 
atq
, each event is numbered and you will have to specify the number of the event with 
atrm as in 
atrm 2
to remove the second item in the scheduled list.
The batch command is identical to the at command except that you do not specify a 
time. If you specify batch by itself, you are dropped into the at
>
prompt; otherwise, you 
would specify 
batch –f 

Download 5,65 Mb.

Do'stlaringiz bilan baham:
1   ...   213   214   215   216   217   218   219   220   ...   254




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish