يستعمل [بورتسنب] أن يحدّث [فريبسد] مين شجرة تجميع
[بورتسنب] نظامة بديلة ل بأمان يوزّع ويحدّث [فريبسد] مين شجرة, أيّ يكون يتيح أن يستعمل من [كفسوب]. تضمّنت [بورتسنب] كان أولى في [فريبسد] 6.0. مثل [كفسوب], يستعمل [بورتسنب] عملّيّة سحب نموذج من يحدّ: ال يعبّئ ويوقع مين وضعت أشجار على [وب سرفر] أيّ ينتظر بشكل سلبيّ لزبونات أن يرجو مبارد ب إمّا يركض [بورتسنب] يدويّا بمستعملات أو ثبتت فوق [كرون] شغل أن يجلب تحديثات تلقائيّا على أساس نظاميّة.
على قديمة [فريبسد] نظامات, تضمّنت [بورتسنب] لا تلقائيّا, غير أنّ هو يستطيع كنت ركّبت من [سسوتيلس/بورتسنب] مينة ب يستعمل أمر:
# [بكغدّ] - [ر] [بورتسنب]
يجلب [بورتسنب] أولى ويحدّ ضماد لقطات من [فريبسد] مين شجرة يخزّن في /var/db/portsnap/ (في /usr/local/portsnap/ إن [بورتسنب] يكون ركّبت من [فريبسد] [بورتس] تجميع) بتقصير, وبعد ذلك فقط يستخرج ويحدّ ال [أونكمبرسّد] حيّة مين شجرة في /usr/ports.
ال ضبطت تصرف وعملية [بورتسنب] بتشكيل مبرد [بورتسنب.كنف] يحدّ في /etc (في /usr/local/etc/ إن [بورتسنب] يكون ركّبت من [فريبسد] [بورتس] تجميع, والتشكيل مبرد لا تلقائيّا ولدت عندما حديثا يركّب, بدلا من ذلك أنت ستؤسّس [بورتسنب.كنف.سمبل], نسخة صحيحة هو ك [بورتسنب.كنف]). عموما, تقصير تشكيل يريد مبرد يتمّ أشغاله.
في [كمّند لين], ساندت الخيارات تالي, رغم أنّ أكثر من الوقت هو ما من حاجة أن يكون استعملت, بعض يستطيع كنت شكّلت في تشكيل مبرد بنفسي:
- [د] [ووركدير]: خزّنت يعمل مبارد ([إ.غ.]. يجلب تحديثات) في [ووركدير]. (تقصير: /var/db/portsnap, أو بما أنّ يعطى في التشكيل مبرد)
- [ف] [كنفّيل]: قرأت التشكيل من من [كنفّيل]. (تقصير: /etc/portsnap.conf)
- أنا: للتحديث أمر, تحديث فهرسة مبارد, غير أنّ لا الإستراحة من المين شجرة.
- [ك] مفتاح: توقّعت مفتاح عامّة مع يعطى [ش256] مزيج. (تقصير: قرأت قيمة من تشكيل مبرد)
- [ب] [بورتسدير]: شغلت عندما يستخرج أو يحدث لقطة [أونكمبرسّد], فوق الدليل [بورتسدير]. (تقصير: /usr/ports/, أو بما أنّ يعطى في التشكيل مبرد.)
- [س] نادلة : جلبت مبارد من ال يعيّن نادلة أو نادلة بركة. (تقصير: portsnap.FreeBSD.org, أو بما أنّ يعطى في التشكيل مبرد.)
ممر: شغلت لمقتطف أمر فقط, فقط على أجزاء من المين شجرة [سترتينغ ويث] ممر. ([إ.غ.]. [بورتسنب] استخرج [سسوتيلس]/مينة [سسوتيلس/بورتسمن], [سسوتيلس/بورتسنب], [سسوتيلس/بورتثبغرد], [إتك.])
الموجز ل [بورتسنب] [كمّند لين]:
[بورتسنب] [- أنا] [- [د] [ووركدير]] [- [ف] [كنفّيل]] [- [ك] مفتاح] [- [ب] [بورتسدير]] [- [س] نادلة] أمر… [ممر]
إستعمال [بورتسنب]
- خلقت يخلو دليل /usr/ports إن هو يتمّ لا يتواجد.
# [مكدير] /usr/ports
-
جلبت وجلبت لقطة مضغوطة من المين تجميع داخل /var/db/portsnap (أو أيّ أخرى موقعة يعيّن في تشكيل مبرد). Internet connection needed at this stage) and update the existing snapshot.
# portsnap fetch
- If you are running Portsnap for the first time (even if a ports tree has already been created or populated, to let Portsnap establishes a baseline from which portsnap can determine which parts of the ports tree need to be updated) or /usr/ports hasn’t been populated, extract the snapshot and replaces the existing files and directories, and establishes Portsnap-maintained ports tree into /usr/ports:
# portsnap extract
This step can be skipped if you’re only updating the ports tree.
- If you already have a populated /usr/ports and you are just updating, run the following command instead:
# portsnap update
Note: For updating of FreeBSD Ports Tree, step 1 and 3 can be combined into single command: portsnap fetch update (not support in older version of Portsnap).
Running Portsnap as Cron Job
portsnap fetch will not be able to execute from a cron job to avoid burden of sudden surge of downloading request to Portsnap servers. Instead, a special portsnap cron command exists, which waits and sleeps for a random duration up to 3600 seconds before fetching updates, as if the fetch command is specified.
To run portsnap automatically with cron job, just add the line into /etc/crontab (the line set the time to 3 AM everyday, you can choose your own timing):
0 3 * * * root /usr/sbin/portsnap cron
This will ensure that the FreeBSD snapshot of ports collection is always up-to-date and can be quickly extracted into /usr/ports.
Note: Running portsnap update from cron is not recommended as it may cause problem if installing or updating of a port happens at the time the cron job runs. Portsnap will updates or removes files which are being used by the port build. However, running portsnap -I update to update the ports Index files is possible, and can be used together with portversion to identify installed software which is out of date.
To update ports compressed snapshot and the INDEX files in /usr/ports/, and send an email if any installed ports are out of date, use the following line in /etc/crontab:
0 3 * * * root portsnap -I cron update && pkg_version -vIL=
Note: Older version of portsnap does not support listing multiple commands (e.g., cron update) in the same invocation of portsnap. If the line above fails, try replacing portsnap -I cron update with portsnap cron && portsnap -I update.
IMPORTANT: This is a machine translated page which is provided "as is" without warranty. Machine translation may be difficult to understand. Please refer to original English article whenever possible.
Share and contribute or get technical support and help at My Digital Life Forums.
Related Articles
- Update FreeBSD Ports Collection to Latest Version with Security Update with Portmanager and Portaudit
- Searching for Application in FreeBSD’s Ports Collection
- Easy Way to Upgrade FreeBSD’s Ports
- Update FreeBSD Ports Collection Up to Date and Latest
- Installing Web Server in FreeBSD 6.0 with Apache 2.2, MySQL 5.0 and PHP 5 - Part 4
- Installing Web Server in FreeBSD 6.0 with Apache 2.2, MySQL 5.0 and PHP 5 - Part 3
- Portdowngrade - Downgrade to Previous Version of FreeBSD’s Ports
- Installing Web Server in FreeBSD 6.0 with Apache 2.2, MySQL 5.0 and PHP 5 - Part 1
- FreeBSD 6.0 on VMware Server Time and Clock Slow Down
- Checking Free Disk Space on FreeBSD Server

































February 9th, 2008 18:04
[...] at My Digital Life, there is an excellent tutorial on using portsnap. It covers not only the basics, but all the rest as [...]