Birmingham mumbai



Download 15,21 Mb.
Pdf ko'rish
bet244/482
Sana13.01.2022
Hajmi15,21 Mb.
#355107
1   ...   240   241   242   243   244   245   246   247   ...   482
Bog'liq
Mastering Ubuntu Server Gain expertise in the art of deploying, configuring, managing, and troubleshooting Ubuntu Server by Jay LaCroix (z-lib.org)

[
 185 
]
Each 
cron
 job has six fields, each separated by at least one space or tab spaces. If you 
use more than one space, or tab, 
cron
 is smart enough to parse the file 
properly. In 
the first field, we have the minute in which we would like the job to occur. In the 
second field, we place the hour in the 24-hour format, from 0-23. The third field 
represents the day of the month. In this field, you can place a 5 (5th of the month), 
23 (23rd of the month), and so on. The fourth field corresponds to the month, such 
as 3 for March or 12 for December. The fifth field is the day of the week, numbered 
from 0-6 to represent Sunday through Saturday. Finally, in the last field, we have the 
command to be executed. A few example 
crontab
 lines are as follows:
3 0 * * 4 /usr/local/bin/cleanup.sh 
* 0 * * * /usr/bin/apt update 
0 1 1 * * /usr/local/bin/run_report.sh 
With the first example, the 
cleanup.sh
 script, located in 
/usr/local/bin
, will be 
run at 12:03 a.m. every Thursday. We know this because the minute column is set 
to 
3
, the hour column is set to 
0
 (midnight), the day column is 
4
 (Thursday), and the 
command column shows a fully qualified command of 
/usr/local/bin/cleanup.sh
.
What does it mean for a command to be 
fully qualified
? Basically, a command being 
fully qualified means that the entire path to the binary responsible for the command 
is completely typed out. In the second example, we could have simply typed 
apt 
update
 for the command and that would've probably worked just fine. However, not 
including the full path to the program is considered bad 
cron
 etiquette. While the 
command may have worked without being fully qualified, its success would depend 
on the application being found in the path of the user who is calling it. Not all 
servers are set up the same, so this might not work depending on how the shell is set 
up. If you include the full path, the job should run regardless of how the underlying 
shell is configured.
If you don't know what the fully qualified command is, all you 
have to do is use the 
which
 command. This command, when used 
with the name of a command you'd like to run, will give you 
the fully qualified command if the command is located on your 
system. 


Controlling and Managing Processes

Download 15,21 Mb.

Do'stlaringiz bilan baham:
1   ...   240   241   242   243   244   245   246   247   ...   482




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