내용으로 건너뛰기
Out of the Box
사용자 도구
로그인
사이트 도구
검색
도구
문서 보기
이전 판
Fold/unfold all
역링크
최근 바뀜
미디어 관리자
사이트맵
로그인
>
최근 바뀜
미디어 관리자
사이트맵
추적:
rsync
이 문서는 읽기 전용입니다. 원본을 볼 수는 있지만 바꿀 수는 없습니다. 문제가 있다고 생각하면 관리자에게 문의하세요.
====== rsync ====== 폴더 동기화 <code bash> rsync -rv --delete {src_ip}:{src_path} {dst_ip}:{dst_path} </code> ssh를 통한 동기화 <code python> os.system(f'''"rsync -rv -e 'ssh -i {key_file} -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null' {src_ip}:{src_path} {dst_ip}:{dst_path}"''') </code> rsync를 이용한 백업 스크립트 <code bash> #!/bin/bash #Website Backup Script #Todays date in ISO-8601 format: DAY0=`date -I` #Yesterdays date in ISO-8601 format: DAY1=`date -I -d "1 day ago"` #The source directory: SRC="{src_user_id}@{src_host}:{src_path}" #The target directory: TRG="{dst_path}/$DAY0" #The link destination directory: LNK="{dst_path}/$DAY1" #The rsync options: OPT="-avh --delete --link-dest=$LNK -e 'ssh -p {port_number}'" #Execute the backup rsync $OPT $SRC $TRG #29 days ago in ISO-8601 format DAY29=`date -I -d "29 days ago"` #Delete the backup from 29 days ago, if it exists if [ -d /backup/website/$DAY29 ] then rm /backup/website/$DAY29 fi </code> cron에 등록 <code bash> sudo ln -s {backup_script} /etc/cron.daily/{backup_script} </code> - http://webgnuru.com/linux/rsync_incremental.php - http://www.howtogeek.com/135533/how-to-use-rsync-to-backup-your-data-on-linux/
rsync.txt
· 마지막으로 수정됨: 2024/03/23 02:38 저자
127.0.0.1
문서 도구
문서 보기
이전 판
역링크
Fold/unfold all
맨 위로