리눅스 / rsync / 동기화 프로그램

rsync는 동기화 프로그램이다. 백업할 때 유용하게 사용할 수 있다.

사용법

기본

  • abc 디렉토리 안의 def 디렉토리를 xyz 디렉토리 안에 동기화시킨다.
  • 처음 실행하는 것이라면 xyz 디렉토리 안에 def 디렉토리가 복사된다.
  • 다시 실행시키면 /abc/def 디렉토리의 내용 중 수정되거나 추가된 것만 /xyz/def 디렉토리로 복사된다.
  • /abc/def에서 삭제된 내용은 /xyz/def에 반영되지 않는다.
# rsync -avz /abc/def /xyz
  • def 뒤에 /를 붙이면 def 디렉토리 안에 있는 폴더와 파일들만 동기화된다. 즉, xyz 디렉토리 안에 def 디렉토리가 생기지 않는다.
# rsync -avz /abc/def/ /xyz

삭제 파일도 동기화하기

  • --delete 옵션을 추가하면, /abc/def에서 삭제된 것은 /xyz/def에서도 삭제된다.
# rsync -avz --delete /abc/def /xyz

특정 디렉토리 제외하기

  • abc 디렉토리 안에 있는 abc-2 디렉토리를 제외하고 동기화한다.
# rsync -avz --exclude 'abc-2' abc xyz

다른 서버와 동기화

  • ssh로 다른 서버에 접속하여 동기화할 수 있다.
  • 도메인 대신 IP를 적어도 되고, 같은 네트워크에 있다면 호스트네임을 적어도 된다.
# rsync -avz --delete -e ssh root@abc.com:/abc/def /xyz
  • ssh 포트를 다른 것으로 사용할 수 있다.
# rsync -avz --delete -e "ssh -p 2345" root@abc.com:/abc/def /xyz

sshpass

  • sshpass를 이용하면 비밀번호 입력을 따로 할 필요가 없다.
# rsync -avz --delete /abc/def --rsh="sshpass -p password ssh -p 2345" root@abc.com:/xyz
같은 카테고리의 다른 글
국세청 홈택스 / 세무서 발송 우편물 홈택스에서 보는 방법

국세청 홈택스 / 세무서 발송 우편물 홈택스에서 보는 방법

세무서에서 여러 가지 우편물을 보내온다. 만약 그 우편물을 분실했거나, 우편물을 받기 곤란한 상황이라면 어떻게 할까? 다행히 국세청 홈택스에서 최근 1년 우편물을 확인할 수 있다. 국세청 홈택스에 로그인한 후 로 간다. 를 클릭한다. 를 클릭하면... 우편물 발송 내역이 나온다. 를 클릭하면... 우편물의 내용을 볼 수 있다.

크롬 / 주소 표시줄 없애는 방법

크롬 / 주소 표시줄 없애는 방법

웹브라우저 상단에 주소 표시줄이 있습니다. 현재 페이지의 URL을 보여주는 곳이고, 검색도 가능합니다. 일반적인 상황에서는 주소 표시줄이 있는 게 편한데, 특별한 경우 없애야 할 때가 있습니다. 예전엔 Focus Mode라 하여 설정에서 안 보이게 할 수 있었는데, 지금은 사라졌습니다. 그 기능은 사라졌지만, 다른 방법으로 주소 표시줄을 없앨 수 있습니다. 상단 오른쪽의 점 세 개 ...

안드로이드 / 앱 / 카카오톡 / 카카오메일 / 알림 설정하는 방법

안드로이드 / 앱 / 카카오톡 / 카카오메일 / 알림 설정하는 방법

카카오톡에서 메일 계정을 만들 수 있다는 것을 보고 만들러 들어갔더니, 이미 만들어 놓았네요. 카카오 메일 만드는 방법을 포스팅도 했었는데, 메일 수신 알림이 한 번도 안와서 까먹고 있었습니다. 그렇다고 메일이 오지 않은 것은 아닙니다. 카카오에서 이런 저런 메일을 보냈네요. 대부분 몰라도 되는 내용이지만, 어떤 건 중요한 것인데... 이유를 찾아보니 알림 설정때문이었습니다. 카카오메일 설정으로 들어갑니다. 을 ...

보안 / IDS와 IPS 비교

Intrusion Detection System(IDS)와 Intrusion Prevention System(IPS)은 모두 네트워크 보안 시스템의 일환으로, 침입을 탐지하고 대응하는 역할을 합니다. 그러나 이 두 시스템은 기능과 목적에서 몇 가지 중요한 차이점이 있습니다. Intrusion Detection System (IDS) IDS는 네트워크나 시스템에서 발생하는 활동을 모니터링하고, 악의적인 활동이나 정책 위반을 탐지하여 관리자에게 경고를 보내는 역할을 합니다. IDS는 침입을 탐지하지만, 이를 차단하지는 ...

리눅스 / 명령어 / which, whereis, locate / 명령어 위치 찾기

명령어의 위치를 찾을 때 사용할 수 있는 명령어에는 which, whereis, locate가 있다. 명령어의 위치만 찾을 때는 which를 사용하고, 관련된 파일들의 위치까지 찾을 때는 whereis나 locate를 사용한다. which 명령어로 find 명령어를 찾는다. # which find /usr/bin/find whereis 명령어로 find 명령어를 찾는다. # whereis find find: /usr/bin/find /usr/share/man/man1/find.1.gz locate 명령어로 find 명령어를 찾는다. # locate find /usr/bin/find /usr/bin/find2perl /usr/bin/findmnt /usr/bin/nl-link-ifindex2name /usr/bin/nl-link-name2ifindex /usr/bin/oldfind /usr/lib64/python2.7/modulefinder.py /usr/lib64/python2.7/modulefinder.pyc /usr/lib64/python2.7/modulefinder.pyo /usr/sbin/btrfs-find-root /usr/sbin/findfs /usr/share/bash-completion/completions/findmnt /usr/share/doc/findutils-4.5.11 /usr/share/doc/findutils-4.5.11/AUTHORS /usr/share/doc/findutils-4.5.11/COPYING /usr/share/doc/findutils-4.5.11/ChangeLog /usr/share/doc/findutils-4.5.11/NEWS /usr/share/doc/findutils-4.5.11/README /usr/share/doc/findutils-4.5.11/THANKS /usr/share/doc/findutils-4.5.11/TODO /usr/share/doc/wpa_supplicant-2.6/examples/p2p/p2p_find.py /usr/share/doc/wpa_supplicant-2.6/examples/p2p/p2p_stop_find.py /usr/share/info/find-maint.info.gz /usr/share/info/find.info.gz /usr/share/locale/be/LC_MESSAGES/findutils.mo /usr/share/locale/bg/LC_MESSAGES/findutils.mo /usr/share/locale/ca/LC_MESSAGES/findutils.mo /usr/share/locale/cs/LC_MESSAGES/findutils.mo /usr/share/locale/da/LC_MESSAGES/findutils.mo /usr/share/locale/de/LC_MESSAGES/findutils.mo /usr/share/locale/el/LC_MESSAGES/findutils.mo /usr/share/locale/eo/LC_MESSAGES/findutils.mo /usr/share/locale/es/LC_MESSAGES/findutils.mo /usr/share/locale/et/LC_MESSAGES/findutils.mo /usr/share/locale/fi/LC_MESSAGES/findutils.mo /usr/share/locale/fr/LC_MESSAGES/findutils.mo /usr/share/locale/ga/LC_MESSAGES/findutils.mo /usr/share/locale/gl/LC_MESSAGES/findutils.mo /usr/share/locale/hr/LC_MESSAGES/findutils.mo /usr/share/locale/hu/LC_MESSAGES/findutils.mo /usr/share/locale/id/LC_MESSAGES/findutils.mo /usr/share/locale/it/LC_MESSAGES/findutils.mo /usr/share/locale/ja/LC_MESSAGES/findutils.mo /usr/share/locale/ko/LC_MESSAGES/findutils.mo /usr/share/locale/lg/LC_MESSAGES/findutils.mo /usr/share/locale/lt/LC_MESSAGES/findutils.mo /usr/share/locale/ms/LC_MESSAGES/findutils.mo /usr/share/locale/nl/LC_MESSAGES/findutils.mo /usr/share/locale/pl/LC_MESSAGES/findutils.mo /usr/share/locale/pt/LC_MESSAGES/findutils.mo /usr/share/locale/pt_BR/LC_MESSAGES/findutils.mo /usr/share/locale/ro/LC_MESSAGES/findutils.mo /usr/share/locale/ru/LC_MESSAGES/findutils.mo /usr/share/locale/rw/LC_MESSAGES/findutils.mo /usr/share/locale/sk/LC_MESSAGES/findutils.mo /usr/share/locale/sl/LC_MESSAGES/findutils.mo /usr/share/locale/sr/LC_MESSAGES/findutils.mo /usr/share/locale/sv/LC_MESSAGES/findutils.mo /usr/share/locale/tr/LC_MESSAGES/findutils.mo /usr/share/locale/uk/LC_MESSAGES/findutils.mo /usr/share/locale/vi/LC_MESSAGES/findutils.mo /usr/share/locale/zh_CN/LC_MESSAGES/findutils.mo /usr/share/locale/zh_TW/LC_MESSAGES/findutils.mo /usr/share/man/man1/find.1.gz /usr/share/man/man1/find2perl.1.gz /usr/share/man/man1/oldfind.1.gz /usr/share/man/man8/btrfs-find-root.8.gz /usr/share/man/man8/findfs.8.gz /usr/share/man/man8/findmnt.8.gz locate 명령어는 -n 옵션으로 출력 ...

브랜드 로고 공식 배포 주소

브랜드 로고 공식 배포 주소

로고를 다운로드 받을 수 있는 공식 주소를 정리한다. 로고 사용에 대한 가이드라인이 있으므로, 공식 주소에서 다운로드하는 것이 좋다. Bootstrap https://getbootstrap.com/docs/5.0/about/brand/ Facebook https://www.facebook.com/brand/resources/facebookapp/logo Facebook Messenger https://www.facebook.com/brand/resources/messenger/messenger-brand HTML5 https://www.w3.org/html/logo/ Intagram https://www.facebook.com/brand/resources/instagram/instagram-brand jQuery https://brand.jquery.org/logos/ Kakao Story Channel https://ch.kakao.com/login LinkedIn https://brand.linkedin.com/downloads MariaDB https://mariadb.com/about-us/logos/ Naver https://logoproject.naver.com/logonaver Naver Band https://developers.band.us/develop/guide/share Naver Line https://line.me/en/logo PHP https://www.php.net/download-logos.php Pinterest https://business.pinterest.com/ko/brand-guidelines/ Python https://www.python.org/community/logos/ Samsung https://www.samsung.com/sec/about-us/brand-identity/logo/ Sass https://sass-lang.com/styleguide/brand Twitter https://about.twitter.com/en/who-we-are/brand-toolkit Visual Studio Code https://code.visualstudio.com/brand YouTube https://www.youtube.com/howyoutubeworks/resources/brand-resources/  

모니터 / 명암비

모니터 명암비(Contrast Ratio)는 화면의 가장 밝은 부분(흰색)과 가장 어두운 부분(검정색) 사이의 밝기 차이를 나타내는 지표입니다. 명암비가 높을수록 더 깊고 진한 검은색과 밝은 흰색을 표현할 수 있어, 화면의 디테일과 색상이 더 선명하게 보입니다. 명암비의 중요성 화질 높은 명암비는 더 선명하고 생생한 이미지를 제공합니다. 어두운 장면에서의 디테일이 더 잘 보이며, 색상의 깊이와 풍부함이 증가합니다. 시청 경험 명암비가 ...

Ubuntu 20.04 Server / GUI 설치하는 방법

Ubuntu 20.04 Server / GUI 설치하는 방법

Ubuntu Server는 CLI(Command Line Interface) 환경으로 설치된다. 그런데 어떤 작업은 GUI(Graphical Uer Interface) 환경에서 하는 것이 편하다. 만약 GUI 환경이 필요하다면 설치하여 사용할 수 있다. GUI 패키지에는 kubuntu-desktop lubuntu-desktop ubuntu-desktop ubuntu-desktop-minimal xubuntu-desktop 등이 있다. 주로 ubuntu-desktop 또는 ubuntu-desktop-minimal을 사용하는 듯 하다. 예를 들어 ubuntu-desktop-minimal을 설치한다면, 다음과 같이 명령하면 된다. # apt install ubuntu-desktop-minimal Minimal임에도 불구하고 꽤 많은 저장소 공간이 필요하다. After ...

Adobe Creative Cloud / 2대 초과 설치 시 나오는 메시지

Adobe Creative Cloud / 2대 초과 설치 시 나오는 메시지

Adobe CC는 사용자 단위 라이선스이다. 로그인해야 사용할 수 있다. 그리고, 두 대의 컴퓨터에서 로그인햐여 활성화할 수 있다. 만약 두 대에 활성화되어 있는 상태에서 또 다른 PC에 설치하고 앱을 실행하면, 아래와 같은 창이 뜬다. 이미 두 대에 활성화되어 있으니 현재 기기를 활성화하려면 다른 기기에서 로그아웃하라는 것이다. 하나를 선택하여 하면... 현재 기기가 활성화된다. 한 명의 사용자가 두 ...

스토리지 / 종류 / DAS, NAS, SAN 등

스토리지 / 종류 / DAS, NAS, SAN 등

데이터를 저장하고 관리하기 위해 다양한 스토리지 솔루션이 존재합니다. 각기 다른 용도와 환경에 적합한 스토리지 종류가 있으며, 여기서는 주요 스토리지 유형들을 소개하고 그 특징과 장단점을 설명하겠습니다. DAS - 직접 연결 스토리지 개요 직접 연결 스토리지(DAS, Direct Attached Storage)는 서버에 직접 연결된 스토리지를 의미합니다. 이는 네트워크를 거치지 않고 직접 연결된다는 점에서 다른 스토리지 유형과 구별됩니다. 특징 고속 ...