°»½Å¿¡ Portsnap¸¦ »ç¿ëÇÏ¿© FreeBSD´Â ³ª¹« ¼öÁýÀ» ÇâÇÑ´Ù

Portsnap´Â ¾ÈÀüÇÏ°Ô »ç¿ëÇϱâ CVSup º¸´Ù´Â ½¬¿î FreeBSD Ç×±¸ ³ª¹«¸¦ ¹èºÎÇÏ°í »õ·Ó°Ô Çϱ⸦ À§ÇÑ ¼±Åà ü°èÀÌ´Ù. Portsnap´Â FreeBSD 6.0¿¡¼­ óÀ½À¸·Î Æ÷ÇԵǾú´Ù. CVSup °°ÀÌ, Portsnap´Â »õ·Ó°Ô ÇϱâÀÇ Àâ¾Æ´ç±â±â ¸ðÇüÀ» ÀÌ¿ëÇÑ´Ù: Æ÷ÀåÇÏ°í ¼­¸íµÈ Ç×±¸ ³ª¹«´Â ÆÄÀÏÀ» ´Þ¸° portsnap¿¡ ÀÇÇÏ¿© »ç¿ëÀÚ¿¡ ÀÇÇÏ¿© ¼öµ¿À¸·Î ¿ä±¸Çϰųª °»½ÅÀ» ÀÚµ¿À¸·Î ´Ù¿î·ÎµåÇÏ´Â cron ÀÏÀ» ¼³Ä¡Çϱâ À§ÇÏ¿© Ŭ¶óÀÌ¾ðÆ®¸¦ Á¤»óÀûÀ¸·Î ¼öµ¿ÀûÀ¸·Î ±â´Ù¸®´Â À¥ ¼­¹ö¿¡ µÐ´Ù.

FreeBSD ´õ ¿À·¡µÈ ü°è¿¡, Portsnap´Â ÀÚµ¿À¸·Î Æ÷ÇÔµÇÁö ¾Ê´Â´Ù, ±×·¯³ª sysutils/portsnap Ç×±¸¿¡¼­ ¸í·ÉÀ» »ç¿ëÇØ¼­ ¼³Ä¡µÉ ¼ö ÀÖ´Ù:

# pkg_add - r portsnap

Portsnap´Â /usr/ports¿¡ ù°·Î °¡Á®¿À°í ºÎÀü½ÂÀ¸·Î /var/db/portsnap/¿¡¼­ (/usr/local/portsnap/¿¡¼­ Portsnap°¡ FreeBSD¿¡¼­ ¼³Ä¡µÇ´Â °æ¿ì¿¡ ¼öÁýÀ» ÇâÇÑ´Ù) ÀúÀåµÈ FreeBSD Ç×±¸ ³ª¹«ÀÇ ¾ÐÂø±â ½º³ÀÀ» »õ·Ó°Ô Çϰí, ±× ÈÄ¿¡ ´ÜÁö uncompressed »ì¾ÆÀÖ´Â Ç×±¸ ³ª¹«¸¦ ÃßÃâÇÏ°í »õ·Ó°Ô ÇÑ´Ù.

PortsnapÀÇ Çൿ ±×¸®°í °¡µ¿Àº /etc¿¡¼­ ÀÖ´Â ±¸¼º ÆÄÀÏ portsnap.conf¿¡ ÀÇÇØ ÅëÁ¦µÈ´Ù (/usr/local/etc/¿¡¼­ ½Å¼±ÇÏ°Ô ¼³Ä¡µÉ ¶§ Portsnap°¡ FreeBSD¿¡¼­ ¼³Ä¡µÇ´Â °æ¿ì¿¡ ¼öÁý ¹× ±¸¼º ÆÄÀÏÀ» ÀÚµ¿À¸·Î »ý¼ºµÇÁö ¾Ê´Â´Ù ÇâÇÑ´Ù, ´ë½Å ´ç½ÅÀº portsnap.conf.sample ÀÇ Á¤´çÇÑ »çº»À» portsnap.conf·Î ±×°Í ã¾Æ³¾ °ÍÀÌ´Ù). ÀϹÝÀûÀ¸·Î, °úÅ ±¸¼º ÆÄÀÏÀº ÇÑ´Ù ±×°ÍÀÇ ÀÏÀ».

Ä¿¸Çµå ¶óÀο¡, µÚ¿¡ ¿À´Â ¼±ÅñÇÀº ´ëºÎºÐÀÇ ½Ã°£¿¡ ±¸¼º ÆÄÀÏ ÀÚü¿¡¼­ »ç¿ëµÇ´Â ÇÊ¿ä, ¾î¶² Çü¼ºµÉ ¼ö ÀÖ´õ¶óµµ, Áö¿øµÈ´Ù:

- d workdir: »óÁ¡ ÀÛ¾÷ ÆÄÀÏ (¿¹¸¦µé¸é. workdir¿¡¼­ ´Ù¿î·ÎµåµÈ °»½Å). (°úÅÂ: ±¸¼º ÆÄÀÏ¿¡¼­ ÁÖ¾îÁö´Â /var/db/portsnap, ¶Ç´Â)

- conffile f: conffile¿¡¼­¿¡¼­ À±°ûÀ» ÀÐÀ¸½Ê½Ã¿À. (°úÅÂ: /etc/portsnap.conf)

- I: °»½Å ¸í·ÉÀ» À§ÇØ, Ç×±¸ ³ª¹«ÀÇ °»½Å »öÀÎ ÆÄÀÏ, ±×·¯³ª ³ª¸ÓÁö ¾Æ´Õ´Ï´Ù.

- k ¿­¼è: ÁÖ¾îÁø SHA256 À½½ÄÀ» °¡Áø °ø¿ë ۰¡ ¿¹»óÇϽʽÿÀ. (°úÅÂ: ±¸¼º ÆÄÀÏ¿¡¼­ °¡Ä¡¸¦ ÀÐÀ¸½Ê½Ã¿À)

- p portsdir: uncompressed ½º³ÀÀ» ÃßÃâÇϰųª »õ·Ó°Ô ÇÒ °æ¿ì, ÀüÈ­¹øÈ£ºÎ portsdir¸¦ À§¿¡ ¿î¿µÇÒ. (°úÅÂ: ±¸¼º ÆÄÀÏ¿¡¼­ ÁÖ¾îÁö´Â /usr/ports/, ¶Ç´Â.)

- s ¼­¹ö : ¼úÃ¥Àº ÁöÁ¤µÈ ¼­¹ö ¶Ç´Â ¼­¹ö ¼ö¿µÀå¿¡¼­ ½ÅûÇÑ´Ù. (°úÅÂ: ±¸¼º ÆÄÀÏ¿¡¼­ ÁÖ¾îÁö´Â portsnap.FreeBSD.org, ¶Ç´Â.)

°æ·Î: ÃßÃâ¹° ¸í·ÉÀ» À§ÇØ, °æ·Î ¸Ç¸ÕÀú Ç×±¸ ³ª¹«ÀÇ ºÎºÐ¿¡¼­¸¸¼­¸¸ ¿î¿µÇϽʽÿÀ. (¿¹¸¦µé¸é. portsnap sysutils ¶Ç´Â Ç×±¸´Â sysutils/portsman, sysutils/portsnap, sysutils/portupgrade, µîµîÀ» ÃßÃâÇÒ °ÍÀÔ´Ï´Ù)

Portsnap Ä¿¸Çµå ¶óÀÎÀ» À§ÇÑ Á¾°üÀº:

portsnap [- I] [- d workdir] [- conffile f] [- k ¿­¼è] [- p portsdir] [- s ¼­¹ö] ¸í·É¡¦ [°æ·Î]

PortsnapÀÇ »ç¿ë¹ý

  1. Á¸ÀçÇÏ¸é °æ¿ì¿¡ ºó ÀüÈ­¹øÈ£ºÎ /usr/ports¸¦ âÁ¶ÇϽʽÿÀ.

    # mkdir /usr/ports

  2. /var/db/portsnap·Î Ç×±¸ ¼öÁý °¡Á®¿À°í ´Ù¿î·ÎµåÇϽʽÿÀ (¶Ç´Â ±¸¼º ÆÄÀÏ¿¡¼­ ÁöÁ¤µÇ´Â ´Ù¸¥ ¾î¶² À§Ä¡)ÀÇ ¾ÐÃà ½º³ÀÀ». Internet connection needed at this stage) and update the existing snapshot.

    # portsnap fetch

  3. 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.

  4. 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.



One Response to ¡°Using Portsnap to Update FreeBSD Ports Tree Collection¡±

  1. Managing FreeBSD Ports « UNIX Administratosphere
    February 9th, 2008 18:04
    1

    [...] at My Digital Life, there is an excellent tutorial on using portsnap. It covers not only the basics, but all the rest as [...]

Leave a Reply

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Subscribe without commenting


Custom Search

New Articles

Incoming Search Terms for the Article

portsnap - freebsd update port tree - portsnap update - freebsd portsnap - update ports tree - portsnap freebsd - Please update your ports tree and try again - portsnap proxy - freebsd 7 portsnap - Please update your ports tree and try again. - portsnap servers - update port tree freebsd - freebsd update ports tree - freebsd portsnap server - portsnap server - freebsd portsnap proxy - portsnap cron - portsnap upgrade - bsd portsnap - => Please update your ports tree and try again. - portsnap how to - freebsd port tree update - portsnap path - portsnap via proxy - pkg_add portsnap - portsnap freebsd 7 - freebsd update portsnap - using portsnap - portsnap portupgrade - freebsd portsnap servers - ports tree update - portsnap fetch extract - freebsd portsnap update - portsnap ports tree missing - freebsd Please update your ports tree and try again - all - how to update the ports tree - freebsd 7 portsnap fetch extract - freebsd update port collection portsnap - freebsd update ports proxy - freebsd updating ports - how to update the port tree in freebsd - FreeBSD 7.0 /usr/ports was not created by portsnap. - how to update ports tree - portaudit and update ports with cron - freebsd portsnap fetch update - FreeBSD command line update - portsnap update log - updating FreeBSD - portsnap 7.0 -