Setting up rsync with Google Drive involves creating a Google Cloud Storage bucket and enabling the Google Drive API. This allows you to sync your files with Google Drive.
Rsync is a powerful tool for syncing files, and Google Drive offers a convenient way to store and access your files from anywhere. To get started, you'll need to install the Google Cloud SDK and set up a project in the Google Cloud Console.
You'll also need to enable the Google Drive API and create credentials for your project, which will be used to authenticate your rsync connections. This will give you a client ID and client secret, which you'll need to store securely.
The rsync command will use these credentials to connect to your Google Drive account and sync your files.
Google Drive Setup
To set up Google Drive with rsync, you'll need to create a credential in your FreeNAS device. Go to System > Cloud Credentials and click ADD to start the process.
Name the credential and select Google Drive as the provider. You'll then need to log in with the appropriate Google user account.
Google will request permission to access all your Google Drive files for the FreeNAS device. Allow access to complete the setup.
Once you've set up the credential, you can authenticate with Google Drive using the --authenticate option. This will provide a URL where you can obtain a GUID from Google.
After authenticating, the GUID will be cached in your ~/.gsync directory. To force authentication again, simply remove this directory.
Cloud Sync Task
To set up a Cloud Sync Task in TrueNAS, go to Tasks > Cloud Sync Tasks and configure the backup time frame, frequency, and folders. You'll need to specify the cloud-based folder and TrueNAS dataset.
The synchronization options are crucial: Sync keeps files newly created or deleted the same, Copy copies new files to the target, and Move copies files to the target and deletes them from the source. You can use Move to set a folder in Google Drive for archival and move older documents to that folder from your Drive account.
The task options are as follows:
- Sync: Keep files newly created or deleted the same.
- Copy: Copy new files to the appropriate target.
- Move: Copy files to the target and delete them from the source.
Once you create the task, attempt a Dry Run to test its feasibility. If the Dry Run succeeds, click SAVE to proceed.
Folders and Files
The folders and files in the rsync Google Drive implementation are listed below, but it's worth noting that the last commit message and date are blank.
The folders and files include 224 Commits, bin, docs/images, libgsync, regression, tests, .gitignore, .pylintrc, CHANGELIST.rst, LICENSE, MANIFEST.in, Makefile, README.rst, and setup.py.
Here's a breakdown of the folders and files:
Sources
- https://sites.google.com/a/case.edu/hpcc/guides-and-training/helpful-references/hpc-environment/transferring-files-hpcc/rclone---google-drive
- https://www.truenas.com/docs/core/coretutorials/tasks/googledrivesync/
- https://www.putorius.net/sync-local-folder-to-google-drive-in.html
- https://wiki.linuxquestions.org/wiki/Rsync_with_Google_Drive
- https://github.com/iwonbigbro/gsync
Featured Images: pexels.com