Ba cheart go n-oibreodh an treoir seo do chóras oibriúcháin DragonFlyBSD, FreeBSD, agus HardenedBSD. Clúdaíonn sé ONLY nuashonruithe/uasghrádaithe pacáistí, agus ní chuireann sé paiste ar bith eile i bhfeidhm ar bhunchóras nó ar eithne.

If you are running FreeBSD 15.0-RELEASE or above, the base system will be updated via pkg as well. Otherwise you would still need to rely on freebsd-update or building it from source. For more information, please see the official FreeBSD Wiki or the Handbook.

TABHAIR FAOI DEARA: Tá gach céim atá doiciméadaithe ar an leathanach seo ag smaoineamh go bhfuil do fhreastalaí tiomnaithe do sheirbhís sealaíochta Tor (droichead/garda/scoir) a sholáthar. Tabhair faoi deara le do thoil go ndéanfar seirbhísí a atosú le linn an phróisis nuashonraithe uathoibríoch bogearraí atá doiciméadaithe anseo.

1. Cruthaigh an Script Nuashonraithe

Úsáidfimid /root/bin/pkg-upgrade.sh dár socrú. Seo mar a chaithfidh sé cuma:

#!/bin/sh
PATH="/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin"
RAND=$(jot -r 1 1980 5940)
ENV="BATCH=yes IGNORE_OSVERSION=yes"
sleep ${RAND}
env ${ENV} pkg update -q -f && \
env ${ENV} pkg upgrade -q -U -y --fetch-only && \
env ${ENV} HANDLE_RC_SCRIPTS=yes pkg upgrade -q -U -y

2. Sceideal a cron Job

For this particular schedule we opt to run the script every 0h00 (depending on your timezone), and will trigger the packages updates process itself depending on the value set to the $RAND variable - it's configured to produce a sleep between 1980 and 5940 seconds (or: 33 and 99 minutes).

More information about the use of jot in there can be found here - thanks to our anonymous cypherpunks. Adapt that to your needs should it be more suited to you.

# echo "0 0 * * * root /bin/sh /root/bin/pkg-upgrade.sh" > /etc/cron.d/pkg-upgrade
  • Más mian leat forghníomhú sceidealta na scripte nuashonraithe a athrú, cumraigh do socruithe crontab chuig luach ar mhaith leat a úsáid.

3. Atosaigh cron

Ar deireadh, atosaigh an deamhan cron chun athruithe cumraíochta a úsáid.

# service cron restart