# Google Drive異地備份方式(Windows) ## Step 1: Install rClone and dependencies download rclone from its’ official website: https://rclone.org/downloads/ unzip it and move the folder to “C:\Programs Files” or wherever you prefer. Download and install winfsp from its’ official website: http://www.secfs.net/winfsp/rel/ ## Step 2: Configure rClone Open cmd.exe with admin permission. ``` >cd C:\Program Files\rclone-v1.56.0-windows-amd64\ >rclone config 2021/08/30 16:45:08 NOTICE: Config file "C:\\Users\\thood\\AppData\\Roaming\\rclone\\rclone.conf" not found - using defaults No remotes found - make a new one n) New remote s) Set configuration password q) Quit config n/s/q> n name> gd Type of storage to configure. Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value 1 / 1Fichier \ "fichier" 2 / Alias for an existing remote \ "alias" 3 / Amazon Drive \ "amazon cloud drive" 4 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, Digital Ocean, Dreamhost, IBM COS, Minio, SeaweedFS, and Tencent COS \ "s3" 5 / Backblaze B2 \ "b2" 6 / Box \ "box" 7 / Cache a remote \ "cache" 8 / Citrix Sharefile \ "sharefile" 9 / Compress a remote \ "compress" 10 / Dropbox \ "dropbox" 11 / Encrypt/Decrypt a remote \ "crypt" 12 / Enterprise File Fabric \ "filefabric" 13 / FTP Connection \ "ftp" 14 / Google Cloud Storage (this is not Google Drive) \ "google cloud storage" 15 / Google Drive \ "drive" 16 / Google Photos \ "google photos" 17 / Hadoop distributed file system \ "hdfs" 18 / Hubic \ "hubic" 19 / In memory object storage system. \ "memory" 20 / Jottacloud \ "jottacloud" 21 / Koofr \ "koofr" 22 / Local Disk \ "local" 23 / Mail.ru Cloud \ "mailru" 24 / Mega \ "mega" 25 / Microsoft Azure Blob Storage \ "azureblob" 26 / Microsoft OneDrive \ "onedrive" 27 / OpenDrive \ "opendrive" 28 / OpenStack Swift (Rackspace Cloud Files, Memset Memstore, OVH) \ "swift" 29 / Pcloud \ "pcloud" 30 / Put.io \ "putio" 31 / QingCloud Object Storage \ "qingstor" 32 / SSH/SFTP Connection \ "sftp" 33 / Sugarsync \ "sugarsync" 34 / Tardigrade Decentralized Cloud Storage \ "tardigrade" 35 / Transparently chunk/split large files \ "chunker" 36 / Union merges the contents of several upstream fs \ "union" 37 / Uptobox \ "uptobox" 38 / Webdav \ "webdav" 39 / Yandex Disk \ "yandex" 40 / Zoho \ "zoho" 41 / http Connection \ "http" 42 / premiumize.me \ "premiumizeme" 43 / seafile \ "seafile" Storage> 15 Google Application Client Id Setting your own is recommended. See https://rclone.org/drive/#making-your-own-client-id for how to create your own. If you leave this blank, it will use an internal key which is low performance. Enter a string value. Press Enter for the default (""). client_id> OAuth Client Secret Leave blank normally. Enter a string value. Press Enter for the default (""). client_secret> Scope that rclone should use when requesting access from drive. Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value 1 / Full access all files, excluding Application Data Folder. \ "drive" 2 / Read-only access to file metadata and file contents. \ "drive.readonly" / Access to files created by rclone only. 3 | These are visible in the drive website. | File authorization is revoked when the user deauthorizes the app. \ "drive.file" / Allows read and write access to the Application Data folder. 4 | This is not visible in the drive website. \ "drive.appfolder" / Allows read-only access to file metadata but 5 | does not allow any access to read or download file content. \ "drive.metadata.readonly" scope> 1 ID of the root folder Leave blank normally. Fill in to access "Computers" folders (see docs), or for rclone to use a non root folder as its starting point. Enter a string value. Press Enter for the default (""). root_folder_id> Service Account Credentials JSON file path Leave blank normally. Needed only if you want use SA instead of interactive login. Leading `~` will be expanded in the file name as will environment variables such as `${RCLONE_CONFIG_DIR}`. Enter a string value. Press Enter for the default (""). service_account_file> Edit advanced config? y) Yes n) No (default) y/n> n Use auto config? * Say Y if not sure * Say N if you are working on a remote or headless machine y) Yes (default) n) No y/n> n Verification code Go to this URL, authenticate then paste the code here. https://accounts.google.com/o/oauth2/auth?access_type=offline&client_id=202264815644.apps.googleusercontent.com&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&response_type=code&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive&state=RIyVbHogRe_GAjGGm-NaeQ Enter a string value. Press Enter for the default (""). config_verification_code> 4/1AX4XfWh04j3lrRsjHT9T0W9A0UW-9nrZRzVz_ZlDSLqi7ymxxhxhjDnXiEg Configure this as a Shared Drive (Team Drive)? y) Yes n) No (default) y/n> n -------------------- [gd] type = drive scope = drive token = {"access_token":"ya29.a0ARrdaM-l8GASUpcnDrfvpA08JMHIywGDRIXLKd9lFZKrmnTMK4SmKw7CaIl4k9DnneDTOE8xeuvmZ2wglxiPpzo7jxlqu1uu1VbUuOZwc6Vfoh1q0Gfgs29xkvt4RNYNmiKH6cZe9ZzCyVHl7g55ehMLzAjI","token_type":"Bearer","refresh_token":"1//0edV_jccU1vPxCgYIARAAGA4SNwF-L9Ir2yfugW48hGxrbHHwP53eVSt5nqC1yGr64a4LbN82q_cmQYmcPLvifNj-mvEkjTMyszA","expiry":"2021-08-30T17:49:17.2798008+08:00"} team_drive = -------------------- y) Yes this is OK (default) e) Edit this remote d) Delete this remote y/e/d> y Current remotes: Name Type ==== ==== gd drive e) Edit existing remote n) New remote d) Delete remote r) Rename remote c) Copy remote s) Set configuration password q) Quit config e/n/d/r/c/s/q> q ``` ## Mount Google Drive to local ``` c:\Program Files\rclone-v1.56.0-windows-amd64>rclone mount gd:\ C:\gd The service rclone has been started. ``` ## Sync Google Drive folder to local folder ``` c:\Program Files\rclone-v1.56.0-windows-amd64>rclone sync -i c:\gd\渡設計有限公司 c:\gdbackup --ignore-size --ignore-checksum -P ```