본문 바로가기
기초 튼튼탄탄탄/서버, OS(리눅스)

Linux(CentOS)와 Google Drive 동기화하기

by 잇서니 2020. 2. 13.
반응형

 

1. DB -> Google Drive

DB 백업기능까지 들어가니, 유료일 가능성이 매우 크다. UI도 있고, 스케쥴링 기능도 있어서 편할 거 같긴 하네.

 

SQLBackupAndFTP Features & version comparison

Feature / EditionThe prices are per computer Professional Lifetime Professional Standard Lite Free $399 Buy now $129 Buy now $89 Buy now $39 Buy now $0 Download Schedule SQL Server, MySQL, and PostgreSQL Backups without interrupting database services max 5

sqlbackupandftp.com

 

 

2. Directory -> Google Drive

어차피 백업툴로 DB 백업을 해놓을테니, 그 파일들만 Google Drive에 옮기면 되지 않을까?

간편하게 FTP 같은 방식으로 CentOS의 특정 디렉토리를 Google Drive와 동기화하는 방법을 써치해봤다.

https://www.ubuntupit.com/top-12-best-google-drive-linux-client-software/

 

Top 12 Best Google Drive Linux Client Software in 2020 | UbuntuPIT

Google Drive Linux Client let you use Google Drive in Linux as Google doesn't offer official Linux Client. Let's check this Linux client list

www.ubuntupit.com

 

grive2

CentOS 7 epel 레포가 필요하다. CentOS 6에서 CentOS 7 epel 레포 사용해서 해볼라했더니 몇개 라이브러리 버전오류 난다. 맘편히 CentOS7에서 사용한다고 생각하자. 

yum install grive2

 

grive -a

구글쪽에서 grive 앱이 로그인하도록 인증 안 해주네. 지금 google 인증 받기 위해 기다리고 있따는데 오래 걸릴 것 같다네. 방법은 있다. 구글에서 OAuth2 client를 발급받고 인증을 다시 하는 방법.

그러고서 grive -a --id --secret으로 인증을 하란다. 근데 --id, --secret 옵션이 안 먹는다. 내가 yum install grive2로 설치한 버전이 최신이 아닌가?

git에서 소스코드 받아서 빌드하는 방식으로 설치해보자. 으악 빌드오류. 

 

https://github.com/vitalif/grive2

 

vitalif/grive2

Google Drive client with support for new Drive REST API and partial sync - vitalif/grive2

github.com

 

https://homaki.tistory.com/105

 

[CentOS 7] 구글 드라이브로 동기화 하기

CentOS 7에서 디렉토리를 구글 드라이브로 동기화 하는 프로그램을 이용해서 자동으로 동기화를 하는 방법을 작성한다. 먼저 구글 드라이브에 동기화 할 수 있는 프로그램인 grive를 설치한다. 우분투에서도 레포..

homaki.tistory.com

 

 

rclone

기본 사용법

# 구글드라이브 디렉토리 목록 조회
rclone lsd remote:rclone_backup

# copy

rclone copy ./test.txt remote:rclone_backup

# sync (디렉은 싱크 안됨)

rclone sync /root/sunny/temp remote:rclone_backup

# 구글드라이브 폴더 생성

rclone mkdir remote:rclone_backup/sunny

# 로컬에서 파일 내용이 바꼈거나 삭제됐으면, 구글드라이브의 백업 디렉에 복사해놓을 수 있음

rclone sync /root/sunny/temp remote:rclone_backup --backup-dir "remote:backups/"`date -I` -vv

# 구글드라이브를 로컬디렉에 마운트 
yum install fuse
rclone mount remote:backups /root/sunny/temp/ --allow-non-empty &

 

주기적으로 sync하는 스크립트 돌리거나, 마운트를 걸어놓고 사용하면 되겠다.

보안문제나 공유드라이브는 어떻게 할 지 추가로 알아봐야겠다.

 

 

https://rclone.org/

 

rclone - rsync for cloud storage

Twitter. Facebook. Reddit.

rclone.org

https://blog.naver.com/binsoore/221214962893

 

구글 드라이브를 Synology NAS에 마운트 하는 방법 - rclone

rclone, synology, google team drive, telegram push rclone 를 아래 경로에서 다운 받는다. 제 경우 syno...

blog.naver.com

 

반응형

댓글