특정 폴더 제외 후 압축하기

 

리눅스/유닉스 환경에서 디렉토리 압축을 할 때, 특정 디렉토리를 제외하고 압축을 해야하는 경우가 있다.

흔히 로그 디렉토리같은 경우는 용량이 커서 압축시 제외를 해야하는데 이럴때는 다음과 같이 사용하면 된다.

 

eclipse 디렉토리에 다음과 같이 구조되어 있다고 보자.

jonathan@jonathan-laptop:~$ ls -l eclipse/
total 684
-rw-r–r–  1 jonathan jonathan  18909 2011-02-10 12:31 about.html
drwxr-sr-x  2 jonathan jonathan   4096 2011-09-28 14:03 about_files
-rw-rw-r–  1 jonathan jonathan 186294 2012-03-29 17:57 artifacts.xml
drwxrwsr-x 10 jonathan jonathan   4096 2012-04-16 13:24 configuration
drwxrwsr-x  2 jonathan jonathan   4096 2010-09-17 16:37 dropins
-rwxr-xr-x  1 jonathan jonathan  63001 2010-10-19 13:44 eclipse
-rw-rw-r–  1 jonathan jonathan    426 2012-03-29 17:57 eclipse.ini
-rw-r–r–  1 jonathan jonathan  16536 2005-02-25 18:53 epl-v10.html
drwxrwsr-x 80 jonathan jonathan  16384 2012-03-29 17:57 features
-rw-r–r–  1 jonathan jonathan   9022 2006-12-11 11:04 icon.xpm
-rwxr-xr-x  1 jonathan jonathan 266168 2006-12-11 11:04 libcairo-swt.so
-rw-r–r–  1 jonathan jonathan   9051 2010-04-27 15:23 notice.html
drwxrwsr-x  5 jonathan jonathan   4096 2010-09-17 16:35 p2
drwxrwsr-x 29 jonathan jonathan  69632 2012-03-29 17:57 plugins
drwxr-sr-x  2 jonathan jonathan   4096 2011-09-28 14:03 readme

이중, p2, plugins, readme 디렉토리를 제외하고 압축을 시도해 보자.
다음과 같이 입력한다.

tar cvfz test.tar.gz eclipse –exclude=eclipse/p2 –exclude=eclipse/plugins –exclude=eclipse/readme

 

kdesvn Error : SSL handshake failed: SSL error: Key usage violation in certificate has been detected.

사내에서 사용하는 SVN 을 이전해서 새로이 kdesvn 설정을 맞추던 중 아래의 에러가 나타났다.

 SSL handshake failed: SSL error: Key usage violation in certificate has been detected.

Virtual Box 에서 사용하는 Windows 의 TortoiseSVN 은 정상으로 접속이 되는데.. 유독 KDESVN 만 접속이 안되는 것이 마음에 걸려 해결방법을 찾아 보았다.

아래의 사이트에서 해결방법을 찾을 수 있었다.

http://andrewbrobinson.com/2011/11/01/fixing-ssl-handshake-failed-ssl-error-key-usage-violation-in-certificate-has-been-detected-error-on-svn-checkout/

kdesvn 에서 사용하는 SSL/TLS 관련 라이브러리 문제로 발생되는 문제였다.

기존에 사용하던 SSL/TLS 관련 라이브러리를 옮겨주고, 새롭게 설치한 SSL/TLS 라이브러리를 심볼링 링크로 걸어주면 문제는 해결된다.

$ sudo apt-get install libneon27
$ sudo mv /usr/lib/libneon-gnutls.so.27 /usr/lib/libneon-gnutls.so.27.old
$ sudo ln -s /usr/lib/libneon.so.27 /usr/lib/libneon-gnutls.so.27

error: ‘EOF’ was not declared in this scope

오픈소스 컴파일 중, 다음과 같은 에러 메시지를 발견했다.

error: ‘EOF’ was not declared in this scope

make[1]: Entering directory `/home/jonathan/workspace/13.CIDS/CIDSSip/SipLibrary/resiprocate-1.6/rutil’
g++         -march=i686 -D_REENTRANT  -g  -Wall  -I.. -I../build/../contrib/ares -DOS_MAJOR_VER=2 -DOS_MINOR_VER=6 -DOS_POINT_VER=38-13-generic-pae -DOS_PATCH_VER=0 -DRESIP_OSTYPE_LINUX -DRESIP_ARCH_I686 -DRESIP_LARCH_IA32 -DRESIP_TOOLCHAIN_GNU -DUSE_ARES -c -o obj.debug.Linux.i686/SysLogBuf.o SysLogBuf.cxx
SysLogBuf.cxx: In member function ‘virtual int resip::SysLogBuf::overflow(int)’:
SysLogBuf.cxx:39:13: error: ‘EOF’ was not declared in this scope
make[1]: *** [obj.debug.Linux.i686/SysLogBuf.o] Error 1
make[1]: Leaving directory `/home/jonathan/workspace/13.CIDS/CIDSSip/SipLibrary/resiprocate-1.6/rutil’
make: *** [rutil] Error 2

이에 대한 해결법은 아래의 링크에서 찾을 수 있었다.

http://code.google.com/p/o3d/issues/detail?id=87

문제 해결은 간단하다. 해당 소스 파일에 아래의 헤더파일을 추가하도록 명시해주면 된다.

#include <cstdio>