사용자 도구

사이트 도구


linux:grive2

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판
이전 판
linux:grive2 [2021/05/15 19:45]
kwon37xi [Debian Build Package]
linux:grive2 [2022/07/19 16:38] (현재)
kwon37xi [Debian Build Package]
줄 6: 줄 6:
   * [[http://www.webupd8.org/2015/05/grive2-grive-fork-with-google-drive.html|Grive2: Grive Fork With Google Drive REST API And Partial Sync Support [PPA] ~ Web Upd8: Ubuntu / Linux blog]]   * [[http://www.webupd8.org/2015/05/grive2-grive-fork-with-google-drive.html|Grive2: Grive Fork With Google Drive REST API And Partial Sync Support [PPA] ~ Web Upd8: Ubuntu / Linux blog]]
  
-===== PPA 설치 =====+===== pacstall 설치 =====
 <code sh> <code sh>
-sudo add-apt-repository ppa:nilarimogard/webupd8 +pacstall -I grive2-git
-sudo apt-get update +
-sudo apt-get install grive+
 </code> </code>
 +
  
 ===== Debian Build Package ===== ===== Debian Build Package =====
줄 20: 줄 19:
     libyajl-dev libboost-all-dev libcurl4-openssl-dev libexpat1-dev \     libyajl-dev libboost-all-dev libcurl4-openssl-dev libexpat1-dev \
     libcppunit-dev binutils-dev debhelper zlib1g-dev dpkg-dev \     libcppunit-dev binutils-dev debhelper zlib1g-dev dpkg-dev \
-    pkg-config libstdc++-7-dev +    pkg-config libstdc++-9-dev 
-# 특히 libstdc++-7-dev 주의! 문서에는 안나오는 의존성임.+# 특히 libstdc++-9-dev 주의! 문서에는 안나오는 의존성임. 또한 Ubuntu 22.04 이전 버전에서는 ''libstdc++-7-dev'' 이었음. 
 + 
 +cd /tmp 
 +git clone https://github.com/vitalif/grive2.git
  
 # 소스 압축푼 디렉토리로 이동(ext 파티션이어야 한다) # 소스 압축푼 디렉토리로 이동(ext 파티션이어야 한다)
 +cd grive2
 +
 dpkg-buildpackage -j4 dpkg-buildpackage -j4
  
 # 상위디렉토리에 deb 패키지 생성됨 # 상위디렉토리에 deb 패키지 생성됨
 sudo dpkg -i <filename.deb> sudo dpkg -i <filename.deb>
 +
 +# 마지막에 오류 발생하는 것은 무시
 +dpkg-buildpackage: info: full upload; Debian-native package (full source is included)
 + signfile grive2_0.5.2+git20210315.dsc
 +gpg: skipped "Vitaliy Filippov <vitalif@yourcmc.ru>": No secret key
 +gpg: dpkg-sign.v7YLDLyX/grive2_0.5.2+git20210315.dsc: clear-sign failed: No secret key
 +
 +dpkg-buildpackage: error: failed to sign .dsc file
 +
 </code> </code>
  
줄 45: 줄 58:
 </code> </code>
  
-On your Drive folder and it will probably work. 
- 
-If you want to use your ID and secret to build grive2 instead of using above command, you can edit the keys in 
- 
-''grive2/grive/src/main.cc'' Lines 49 to 50 in 3929909 
-<code c> 
- const std::string default_id            = "615557989097-i93d4d1ojpen0m0dso18ldr6orjkidgf.apps.googleusercontent.com" 
- const std::string default_secret        = "xiM8Apu_WuRRdheNelJcNtOD" 
-</code> 
  
 ===== 사용 ===== ===== 사용 =====
줄 69: 줄 73:
 # 혹은 # 혹은
 grive -p /path/to/SyncDir grive -p /path/to/SyncDir
-</code> 
-  * 지속적 동기화 <code sh> 
-# /home/myhome/GoogleDrive 디렉토리를 매시 15분, 45분마다 동기화하고 로그를 /tmp/grivesync.log로 남긴다. 
-15,45 * * * * /usr/bin/grive -p '/home/myhome/GoogleDrive' -V -l /tmp/grivesync.log 
 </code> </code>
  
줄 82: 줄 82:
   * **NTFS 파티션**에서 오류가 발생했다. [[linux:partition|Linux Partition]]을 참조하여 ''/etc/fstab/''의 해당 파티션 옵션에 ''fmask=111,uid=1000''을 추가했더니 잘 작동했다.   * **NTFS 파티션**에서 오류가 발생했다. [[linux:partition|Linux Partition]]을 참조하여 ''/etc/fstab/''의 해당 파티션 옵션에 ''fmask=111,uid=1000''을 추가했더니 잘 작동했다.
  
 +===== 동기화 =====
 +  * [[linux:systemd|systemd]] 서비스를 제공해주는데, 시간 기반과 파일 변경기반 두가지를 제공해준다.
 +  * 하나의 구글 드라이브에 대해서 둘 중의 하나만 적용해야 한다.
 +  * 아래 예에서 ''google-drive'' 는 ''$HOME'' 에 있는 구글 드라이브 디렉토리이다.
 +
 +==== time based ====
 +<code sh>
 +systemctl --user enable grive-timer@$(systemd-escape google-drive).timer
 +systemctl --user start grive-timer@$(systemd-escape google-drive).timer
 +</code>
 +
 +==== change based ====
 +  * ''inotify-tools'', ''inotifywait'' 명령으로 변경 감지 동기화
 +
 +<code sh>
 +systemctl --user enable grive-changes@$(systemd-escape google-drive).service
 +systemctl --user start grive-changes@$(systemd-escape google-drive).service
 +</code>
 +
 +==== log ====
 +<code sh>
 +journalctl -f --user-unit=grive-timer@$(systemd-escape google-drive).timer
 +journalctl -f --user-unit=grive-changes@$(systemd-escape google-drive).service
 +</code>
 +  * 만약 systemd 서비스가 작동하지 않는다면 ''grive-sync.sh'' 파일의 경로가 잘못됐을 수 있다.
 +  * ''/usr/[local/]lib/systemd/user/grive-timer@.service'' 혹은 ''/usr/[local/]lib/systemd/user/grive-changes@.service'' 파일에서 ''grive-sync.sh'' 파일 경로 확인.
 +  * 현재 해당 파일이 ''/lib/x86_64-linux-gnu/grive/grive-sync.sh''로 설치 됐는데, ''/usr/libexec/grive''에서 찾는 현상 발생
 +  * pacstall로 설치시에는 ''/usr/local/libexec/grive/grive-sync.sh''
 +
 +<code sh>
 +cd /usr/libexec
 +sudo mkdir -p /usr/libexec/grive
 +cd /usr/libexec/grive
 +sudo ln -s /lib/x86_64-linux-gnu/grive/grive-sync.sh
 +</code>
  
linux/grive2.1621075529.txt.gz · 마지막으로 수정됨: 2021/05/15 19:45 저자 kwon37xi