|
|
|
|
|
|
|
Á¦¸ñ: ¸®´ª½º »ç¿ë Tips |
ÀÌÆäÀÌÁöÀÇ ÀúÀÛ±ÇÀº ÀúÀÚ¿¡°Ô
ÀÖ½À´Ï´Ù |
|
ÀúÀÚ: Á¤ÀçÁØ(rgbi3307@nate.com) |
ÃÖ±Ù¼öÁ¤ÀÏ:2009-01-04 |
|
|
|
|
¸®´ª½º »ç¿ë Tips 1. tar »ç¿ë¹ý 2. NFS(Network File System) ¼³Á¤ |
1. tar »ç¿ë¹ý
GNU ¡°tar¡±´Â ¸¹Àº ÆÄÀϵéÀ» Çϳª·Î ¹¾î¼ ¾ÐÃàÇÏ¿© º¸°üÇϰí, º¸°üµÈ °ÍÀ» ´Ù½Ã º¹±¸ÇÕ´Ï´Ù.
|
»ç¿ë¹ý: tar [OPTION]...
[DIR/FILE]... ±âº» ¿É¼Ç: -c, --create
tarÆÄÀÏ »ý¼ºÇÒ ¶§ »ç¿ë -x, --extract, --get tarÆÄÀÏ ÃßÃâ(ÇØÁ¦) -t, --list
tarÆÄÀÏÀÇ ³»¿ëÀ» È®ÀÎÇÒ ¶§ »ç¿ë -f
tarÆÄÀÏÀ» »ç¿ëÇÒ ¶§ »ç¿ë (±âº»»ç¿ë) -p
tarÆÄÀÏÀ» »ý¼ºorÇ®¶§ ¿øº» ÆÄÀϼӼº(ÆÛ¹Ì¼Ç) À¯Áö -v
¹°Å³ª
Ç® ¶§ °úÁ¤ º¸±â -z
gzip(gunzip) ¾ÐÃà ¿É¼Ç (ÆÄÀϸí.tar.gz) -j
bzip(bunzip2) ¾ÐÃà ¿É¼Ç (ÆÄÀϸí.tar.bz2) -d, --diff, --compare ¾ÆÄ«À̺ê¿Í ÆÄÀÏ ½Ã½ºÅÛ°£ÀÇ Â÷ÀÌÁ¡À»
ºñ±³ÇÕ´Ï´Ù -r, --append
¾ÆÄ«ÀÌºê ³¡¿¡ ÆÄÀÏÀ» Ãß°¡ÇÕ´Ï´Ù -u, --update ¾ÆÄ«À̺ê
¾ÈÀÇ °Íº¸´Ù »õ·Î¿î ÆÄÀϸ¸ Ãß°¡ÇÕ´Ï´Ù -A, --catenate
¾ÆÄ«À̺꿡 tar ÆÄÀÏÀ» Ãß°¡ÇÕ´Ï´Ù --concatenate
-A¿Í °°À½ --delete
¾ÆÄ«À̺ê·ÎºÎÅÍ Á¦°ÅÇÕ´Ï´Ù (ÀÚ±â Å×ÀÌÇÁ¿¡¼± ¾ÈµÊ!) »ç¿ë¿¹: tar -cf archive.tar file1 file2 # file1°ú file2¸¦ Çϳª·Î ¹¾î¼ archive.tarÆÄÀÏ »ý¼º tar -tvf archive.tar # archive.tar ¾ÈÀÇ ÆÄÀϵéÀ»
º¸¿©ÁÜ tar -xf archive.tar # archive.tar ÆÄÀϾȿ¡ ¾ÐÃàµÈ
ÆÄÀϵéÀ» ÇØÁ¦ÇÏ¿© ÃßÃâÇÔ tar cvzf file.tar.gz dir/* # dir°æ·Î¾ÈÀÇ
¸ðµç ÆÄÀÏÀ» file.tar.gz ÆÄÀÏ·Î ¾ÐÃà tar tvzf file.tar.gz
# file.tar.gz ÆÄÀϾȿ¡ ¾ÐÃàµÈ ÆÄÀϸ®½ºÆ® º¸±â tar xvzf file.tar.gz
# file.tar.gz ÆÄÀϾȿ¡ ¾ÐÃàµÈ ÆÄÀÏ ÇØÁ¦(ÃßÃâ) tar cvjf file.tar.bz2 dir/* # dir°æ·Î¾ÈÀÇ ¸ðµç ÆÄÀÏÀ»
file.tar.bz2 ÆÄÀÏ·Î ¾ÐÃà tar tvjf file.tar.bz2
# file.tar.bz2 ÆÄÀϾȿ¡ ¾ÐÃàµÈ ÆÄÀϸ®½ºÆ® º¸±â tar xvjf file.tar.bz2
# file.tar.bz2 ÆÄÀϾȿ¡ ¾ÐÃàµÈ ÆÄÀÏ ÇØÁ¦(ÃßÃâ) #/home/ °æ·Î¾ÈÀÇ ¸ðµçÆÄÀÏÀ» 600MB´ÜÀ§·Î ºÐ¸®ÇÏ¿©
file.tar.gz À¸·Î ¾ÐÃà tar cvzf - /home/* | split -b 600mb -
./file.tar.gz #À§ÀÇ ÆÄÀϵéÀ» ¾ÐÃàÇØÁ¦ cat file.tar.gz* | tar xvzf - Operation modifiers: -W, --verify
attempt to verify the archive after writing it --remove-files
remove files after adding them to the archive -k, --keep-old-files don't replace existing files
when extracting --overwrite
overwrite existing files when extracting --overwrite-dir
overwrite directory metadata when extracting -U, --unlink-first remove each file
prior to extracting over it --recursive-unlink empty hierarchies
prior to extracting directory -S, --sparse
handle sparse files efficiently -O, --to-stdout
extract files to standard output -G, --incremental handle old
GNU-format incremental backup -g, --listed-incremental=FILE
handle new GNU-format incremental backup --ignore-failed-read do not exit with nonzero on
unreadable files Handling of file attributes: --owner=NAME
force NAME as owner for added files --group=NAME
force NAME as group for added files --mode=CHANGES force
(symbolic) mode CHANGES for added files --atime-preserve
don't change access times on dumped files -m, --modification-time don't extract file modified time --same-owner
try extracting files with the same ownership --no-same-owner extract
files as yourself --numeric-owner always use
numbers for user/group names -p, --same-permissions extract permissions
information --no-same-permissions do not extract
permissions information --preserve-permissions same as -p -s, --same-order
sort names to extract to match archive --preserve-order
same as -s --preserve
same as both -p and -s ÀåÄ¡ ¼±Åðú Àüȯ: -f, --file=ARCHIVE ¾ÆÄ«ÀÌºê ÆÄÀÏ
¶Ç´Â ARCHIVE ÀåÄ¡¸¦ »ç¿ëÇÕ´Ï´Ù --force-local
À̸§¿¡ ÄÝ·ÐÀÌ ÀÖ´Â ¾ÆÄ«ÀÌºê ÆÄÀϵµ Áö¿ª ÆÄÀÏ·Î
ÀνÄÇÕ´Ï´Ù --rsh-command=COMMAND rsh ´ë½Å ¿ø°Ý
COMMAND¸¦ »ç¿ëÇÕ´Ï´Ù -[0-7][lmh]
µå¶óÀ̺ê¿Í ±â·Ï ¹Ðµµ¸¦ ÁöÁ¤ÇÕ´Ï´Ù -M, --multi-volume
´ÙÁß º¼·ý ¾ÆÄ«À̺긦 »ý¼º/Ãâ·Â/ÃßÃâÇÕ´Ï´Ù -L, --tape-length=NUM NUM x 1024
¹ÙÀÌÆ®¸¦ ¾´ µÚ¿¡ Å×ÀÌÇÁ¸¦ ¹Ù²ß´Ï´Ù -F, --info-script=FILE °¢ Å×ÀÌÇÁÀÇ ³¡¿¡¼ ½ºÅ©¸³Æ®¸¦
½ÇÇàÇÕ´Ï´Ù
(-MÀ» Æ÷ÇÔÇÔ) --new-volume-script=FILE -F FILE°ú °°À½ --volno-file=FILE FILE ¾È¿¡ ÀÖ´Â
º¼·ý ¹øÈ£¸¦ »ç¿ë/°»½ÅÇÕ´Ï´Ù ÀåÄ¡ ºí·° ¼³Á¤: -b, --blocking-factor=BLOCK ·¹ÄÚµå´ç BLOCK x 512 ¹ÙÀÌÆ® --record-size=SIZE
·¹ÄÚµå´ç SIZE ¹ÙÀÌÆ®, 512ÀÇ ¹è¼ö -i, --ignore-zeros
¾ÆÄ«À̺꿡¼ ¿µÀ¸·Î µÈ ºí·°À» ¹«½ÃÇÕ´Ï´Ù
(EOF¸¦
ÀǹÌÇÔ) -B, --read-full-records ÀÐÀº °ÍÀ» Àçºí·°ÈÇÕ´Ï´Ù (4.2BSD ÆÄÀÌÇÁ¿ëÀ¸·Î) Archive format selection: -V, --label=NAME
create archive with volume name NAME
PATTERN
at list/extract time, a globbing PATTERN -o, --old-archive, --portability write a V7 format archive --posix
write a POSIX format archive -j, --bzip2
filter the archive through bzip2 -z, --gzip, --ungzip
filter the archive through gzip -Z, --compress, --uncompress filter the archive through
compress --use-compress-program=PROG filter through PROG (must
accept -d) Local file selection: -C, --directory=DIR change to
directory DIR -T, --files-from=NAME get names to extract
or create from file NAME --null
-T reads null-terminated names, disable -C --exclude=PATTERN
exclude files, given as a PATTERN -X, --exclude-from=FILE exclude patterns listed in FILE --anchored
exclude patterns match file name start (default) --no-anchored
exclude patterns match after any / --ignore-case
exclusion ignores case --no-ignore-case
exclusion is case sensitive (default) --wildcards
exclude patterns use wildcards (default) --no-wildcards
exclude patterns are plain strings --wildcards-match-slash exclude pattern wildcards match '/'
(default) --no-wildcards-match-slash exclude
pattern wildcards do not match '/' -P, --absolute-names don't strip
leading `/'s from file names -h, --dereference
dump instead the files symlinks point to --no-recursion
avoid descending automatically in directories -l, --one-file-system stay in local file
system when creating archive -K, --starting-file=NAME begin at file NAME in the archive -N, --newer=DATE
only store files newer than DATE --newer-mtime=DATE compare
date and time when data changed only --after-date=DATE
same as -N --backup[=CONTROL] backup
before removal, choose version control --suffix=SUFFIX backup
before removal, override usual suffix Á¤º¸ Ãâ·Â¿¡ °üÇÑ ¿É¼Ç: --help
ÀÌ µµ¿ò¸»À» ÀμâÇÏ°í ³¡³À´Ï´Ù --version
tar ÇÁ·Î±×·¥ÀÇ ¹öÀü ¹øÈ£¸¦ ÀμâÇÏ°í ³¡³À´Ï´Ù -v, --verbose 󸮵Ǵ ÆÄÀÏÀ» ¼ø¼´ë·Î Ãâ·ÂÇÕ´Ï´Ù --checkpoint ¾ÆÄ«À̺긦 ÀÐÀ» µ¿¾È µð·ºÅ丮
À̸§À» ÀμâÇÕ´Ï´Ù --totals ¾ÆÄ«À̺긦 ¸¸µé µ¿¾È
¾²¿©Áø ÃÑ ¹ÙÀÌÆ® ¼ö¸¦ ÀμâÇÕ´Ï´Ù -R, --block-number °¢ ¸Þ½ÃÁö¸¶´Ù ¾ÆÄ«À̺곻ÀÇ ºí·° ¹øÈ£¸¦ Ç¥½ÃÇÕ´Ï´Ù -w, --interactive ¸ðµç Çൿ¿¡ ´ëÇØ È®ÀÎÀ» ¿ä±¸ÇÕ´Ï´Ù --confirmation -w¿Í °°À½ |
2. NFS(Network File System) ¼³Á¤
|
¼¹ö(192.168.0.2): /etc/exports ©¬ ÆíÁý #/home/nfs 192.168.0.3(rw,syns,no_root_squash) ©¬ permisson denied ¹ß»ýÇÔ /home/nfs 192.168.0.3(rw,root_squash,insecure) # chmod 777 /home/nfs
©¬ write ±ÇÇÑ ºÎ¿© # chown nobody /home/nfs
©¬ »ó°ü¾øÀ½ # /etc/rc.d/init.d/nfs start ©¬ NFS ½ÃÀÛ # rpcinfo –p ©¬ rpc µ¥¸óÈ®ÀÎ 100000
2 tcp 111 portmapper
100000 2 udp 111
portmapper
100024 1 udp 32768 status
100024 1 tcp 32768 status
100011 1 udp 1010
rquotad 100011
1 tcp 1013 rquotad 100003
2 udp 2049 nfs 100021
1 udp 32770 nlockmgr 100005
1 udp 32771 mountd
100005 1 tcp 32769 mountd # setup ©¬ service È®ÀÎ [*]nfs [*]portmap Ŭ¶óÀ̾ðÆ®(192.168.0.3): ©¬ ¼¹öÀÇ /home/nfs °æ·Î¸¦ /mnt/nfs ¿¡ ¸¶¿îÆ® mount -t nfs -o nolock 192.168.0.2:/home/nfs /mnt/nfs |
|
|
|
|
|
|
|
|
|
|
Á¦¸ñ: ¸®´ª½º »ç¿ë Tips |
ÀÌÆäÀÌÁöÀÇ ÀúÀÛ±ÇÀº ÀúÀÚ¿¡°Ô
ÀÖ½À´Ï´Ù |
|
ÀúÀÚ: Á¤ÀçÁØ(rgbi3307@nate.com) |
ÃÖ±Ù¼öÁ¤ÀÏ:2009-01-04 |