Kugadziriswa kweanachrontab. Linux uye zvivi zvinouraya chikamu chechina

anacron man page

Anacron inokutendera kuti umhanye zvirongwa kunyangwe zuva rakatarwa rapfuura.


Tiri kugadzira rondedzero yesoftware uye maturusi eLinux anoshandiswa segwara kune zvinomwe zvinouraya zvivi rondedzero. Semuzvinyorwa zvakapfuura, tinoshandisa usimbe sechikonzero taura nezve otomatiki maturusi muLinux. Mumwe wavo ari anakironi. Muchikamu chino tichaona kuti kugadziridzwa kweanacrontab kuri sei. anacrontab ndiyo inoudza anacron zvekuita uye nguva yekuzviita.

Muanacron zuva remabasa rakagadziriswa mumazuva uye, kana komputa isiri kushanda panguva yekuita basa, inotanga kana yatanga.

Iyo anacrontab gadziriso

Pakutanga anacron inotarisa rondedzero yemabasa ekuita mudhairekitori /etc/anacrontab. Mabasa anofanirwa kunyorwa nenzira inotevera:

período retraso identificador del trabajo comando donde:

  • nguva: Frequency iyo basa rinofanira kuitwa. Inogona kuratidzwa mumazuva (chidimbu chayo muChirungu) nguva ( @daily, @weekly, kana @monthly yezuva, vhiki kana mwedzi) kana nenhamba (1 yezuva, 7 yevhiki, 30 yemwedzi uye chero nhamba ye nguva yakasarudzika yemazuva.
  • kunonoka: Nguva yekumirira usati watanga basa. Semuenzaniso 360 kuita basa na6 mangwanani.
  • chiziviso chebasa: Zita rakapihwa basa kuti risiyanise kubva kune vamwe mukukanganisa uye mishumo yemhedzisiro
  • .

  • command: Ndiwo murairo uyo anacron inofanira kuita panguva yakaratidzwa.

Sezvo chinangwa chedu chiri chekushandisa anacron kumabasa asina chekuita nehurongwa hwekutonga, isu tiri kuzodzokorora madhairekitori anoshandiswa necron mune yedu yemuno mushandisi folda. tinozviita nayo

mkdir -p ~/.local/etc/anacrontab: ~/.local/etc/cron.daily ~/.local/etc/cron.weekly ~/.local/etc/cron.daily  ~/.var/spool/anacron

Neizvi isu tinogadzira madhairekitori ekuchengetedza akasiyana zuva nezuva, vhiki nevhiki uye pamwedzi zvinyorwa, pamwe nenzvimbo iyo mushumo wekupedzisira kuurayiwa kweanacron uchachengetwa.

Pakupedzisira, tinoudza anacron kushandisa maforodha edu emushandisi panzvimbo peiyo system.

anacron -fn -t ~/.local/etc/anacrontab -S ~/.var/spool/anacron

Iye zvino tava kuzogadzirisa faira rekugadzirisa. Isu tinozviita kubva kune terminal ne:

nano ~/.local/etc/anacrontab:

Mugwaro rinovhura tinowedzera mitsara iyi:

SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

Iyi mitsetse inozadzisa mabasa akafanana atakatsanangura kare kune crontab. Ratidza kuti unofanirwa kushandisa Bash semuturikiri wekuraira uye mune madhairekitori ekutsvaga zvinogoneka. Isu tinochengetedza gwaro na Chivabvu +0 uye tinoivhara nayo Shift + X.

Zita uye nzvimbo ye cron folders yatinogadzira isarudzo isina musoro. Ini ndasarudza kuchengetedza izvo zvakasara kuti ndisavhiringa vaverengi vanoda rumwe ruzivo kubva kune mamwe masosi. Chero bedzi nzira inoenda kune script inoratidzwa muacrontab, unogona kushandisa yakasarudzika folda uye nzira yekuchengetedza. Zvakafanana zvinoenda kune chiziviso chebasa.

Pane mamwe maviri akasiyana-siyana atinogona kugadzirisa:

  • START_HOURS_RANGE
  • : Inotara nguva ichatanga mabasa (kureva mhanyisa mabasa chete mukati memaawa anotevera).

  • RANDOM_DELAY
  • : Izvi zvinotsanangura kunonoka kunonoka kwakawedzerwa kune mushandisi-anotsanangurwa kunonoka kwebasa (default ndeye 45).

Ndeupi musiyano uripo pakati pecron uye anacron?

cron ndizvo zviri mumasisitimu uye zvinobva kune inozivikanwa sea daemon ndiko kuti, chirongwa chinomhanya kumashure uye pasina kupindira kwemushandisi. Yakagadzirirwa maseva, ndiko kuti, midziyo inoshanda chinenge zvachose pasina kudiwa kwemunhu upi noupi kuti aiteerere, asi inoda nguva dzose mabasa ekugadzirisa.

anacron chirongwa chakajairika zvakanyanya kufanirwa kune desktops Havasi kuenderera mberi. Ndokusaka, kusiyana necron, uko iyo diki yuniti yenguva iminiti, inoshanda nehushoma frequency yezuva rimwe.

Nechikonzero chimwe chete, cron haisanganisi dzimwe nzira kana komputa isina kuvhurwa.
kana kuti anacron ichipfuura nepakati pemabasa akamirira pakupinda. Kana ikawana basa risati ratanga panguva yakatarwa, ichaita murairo unotsanangurwa mundima yekuraira mushure mekumirira nhamba yemaminitsi anotsanangurwa mundima yekunonoka. Iyo inozoisa iyo zuva kune timestamp faira.


Izvo zviri muchinyorwa zvinoomerera pamisimboti yedu ye tsika dzekunyora. Kuti utaure chikanganiso tinya pano.

Iva wekutanga kutaura

Siya yako yekutaura

Your kero e havazobvumirwi ichibudiswa.

*

*

  1. Inotarisira data: AB Internet Networks 2008 SL
  2. Chinangwa cheiyo data: Kudzora SPAM, manejimendi manejimendi.
  3. Legitimation: Kubvuma kwako
  4. Kutaurirana kwedata
  5. Dhata yekuchengetedza: Dhatabhesi inobatwa neOccentus Networks (EU)
  6. Kodzero: Panguva ipi neipi iwe unogona kudzora, kupora uye kudzima ruzivo rwako