맛집 여행 캠핑 일상 생활

RSYNC 폴더 생성 옵션 본문

IT이야기

RSYNC 폴더 생성 옵션

♥ 영은파더♥ 2020. 7. 6. 17:09

rsync 옵션에서 디렉토리를 생성하는 옵션이 뭔가 싶어 찾아봤습니다.

# rsync --help | grep dir
 -r, --recursive             recurse into directories
     --no-implied-dirs       don't send implied dirs with --relative
 -b, --backup                make backups (see --suffix & --backup-dir)
     --backup-dir=DIR        make backups into hierarchy based in DIR
     --suffix=SUFFIX         set backup suffix (default ~ w/o --backup-dir)
 -d, --dirs                  transfer directories without recursing
 -L, --copy-links            transform symlink into referent file/dir
 -k, --copy-dirlinks         transform symlink to a dir into referent dir
 -K, --keep-dirlinks         treat symlinked dir on receiver as dir
     --chmod=CHMOD           affect file and/or directory permissions
 -O, --omit-dir-times        omit directories from --times
     --remove-source-files   sender removes synchronized files (non-dirs)
     --delete                delete extraneous files from destination dirs
     --delete-excluded       also delete excluded files from destination dirs
     --force                 force deletion of directories even if not empty
     --partial-dir=DIR       put a partially transferred file into DIR
 -m, --prune-empty-dirs      prune empty directory chains from the file-list
 -T, --temp-dir=DIR          create temporary files in directory DIR
 -F                          same as --filter='dir-merge /.rsync-filter'

-r 옵션을 사용하면 되는군요~

rsync -r -e 'ssh -p포트번호' /home/dir1/ root@192.168.1.2:/home/dir1/

원격지 서버에 /home/dir1 이 없다면 생성해준다는 의미입니다.

 

Trackback : 0 | Comments : 0
댓글쓰기 폼