TrueNAS SCALETrueNAS SCALE Nightly Development Documentation
This content follows experimental early release software. Use the Product and Version selectors above to view content specific to a stable software release.

Adding a Google Photos Cloud Sync Task

Google Photos works best in TrueNAS using a Google Photos API key and rclone token.

Creating the API Credentials

On the Google API dashboard, click the dropdown menu next to the Google Cloud logo and select your project. If you do not have a project, click NEW PROJECT and enter a value in Project name, Organization, and Location.

GooglePhotosAPINewProject

Enable API

After you select your project, click Enabled APIs & Services on the left menu, then click + ENABLE APIS AND SERVICES.

GooglePhotosAPIEnableAPIsandServices

Enter photos library api in the search bar, then select Photos Library API and click ENABLE.

GooglePhotosAPIPhotosLibraryAPISearch

GooglePhotosAPIClickEnable

Configure Authentication

Next, click OAuth consent screen on the left menu, select EXTERNAL, then click CREATE.

GooglePhotosAPICreateExternal

Enter a value in App name and User support email.

GooglePhotosAPIAppInformation

Enter an email address in the Developer contact information section, then click SAVE AND CONTINUE.

GooglePhotosAPIDeveloperContactInformation

Continue to the Add users section, enter your email address, then click ADD.

GooglePhotosAPIAddTestingUser

On the OAuth consent screen, click PUBLISH APP under Testing and push the app to production.

GooglePhotosAPIPublish

Can I leave the app in testing mode? You can leave the app in testing mode, but your cloud sync task fails when your testing app credentials expire after seven days.

Create Credentials

Click Credentials on the left menu, then click + CREATE CREDENTIALS and select OAuth client ID.

GooglePhotosAPIAddCredentials

Select Desktop app in the Application type dropdown, then enter a name for the client ID and click CREATE.

GooglePhotosAPICreateOAuthClientID

Copy and save your client ID and secret, or download the JSON file.

GooglePhotosAPICopyIDandSecret

Configuring Rclone

Download rclone for your OS and open it in a command line utility. The example photos in this article use Powershell in Windows OS.

Enter rclone config, then enter n to create a new remote.

GooglePhotosAPIrcloneConfig

Enter a name for the new remote, then enter the number from the list corresponding to Google Photos.

Enter the client id and secret you saved when you created the Google Photos API credentials, then enter false to keep the Google Photos backend read-only.

GooglePhotosAPIrcloneConfig2

Do not edit the advanced config. When prompted about automatically authenticating rclone with the remote, enter y.

A browser window opens to authorize rclone access. Click Allow.

In the command line, enter y when prompted about media item resolution to complete the configuration.

Copy and save the type, client_id, client_secret, and token, then enter y to keep the new remote.

GooglePhotosAPIrcloneConfig3

Creating Google Photos Cloud Credentials

Open your TrueNAS Web UI. Go to Credentials > Backup Credentials and click Add in the Cloud Credentials widget.

GooglePhotosAPIAddCloudCredentials

Select Google Photos as the Provider and enter a name.

Do not click Log In To Provider.

Paste the Google Photos API client ID and client secret in the OAuth Client ID and OAuth Client Secret fields.

Paste your rclone token into the Token field.

Click Verify Credential to ensure you filled out the fields correctly, then click Save.

Creating the Cloud Sync Task

To add a cloud sync task, go to Data Protection > Cloud Sync Tasks and click Add. The Cloudsync Task Wizard opens.

CloudSyncTaskWizardProviderScreen

  1. Select an existing backup credential from the Credential dropdown list. If not already added as a cloud credential, click Add New to open the Cloud Credentials screen to add the credential. Click Save to close the screen and return to the wizard.

  2. Click Next to open the Where and When wizard screen.

    CloudSyncTaskWizardWhatandWhenScreen

  3. Select the option from Direction and in Transfer Mode. Select the location where to pull from or push data to in the Folder field.

  4. Select the dataset location in Directory/Files. Browse to the dataset to use on SCALE for data storage. Click the arrow to the left of the name to expand it, then click on the name to select it.

    If Direction is set to PUSH, click on the folder icon to add / to the Folder field.

    Browsing to select a path

    Click the arrow to the left of the folder icon to expand that folder and show any child datasets and directories. A solid folder icon shows for datasets and an outlined folder for directories. A selected dataset or directory folder and name shows in blue.

  5. Cloud provider settings change based on the credential you select. Select or enter the required settings that include where files are stored. If shown, select the bucket on the Bucket dropdown list.

  6. Select the time to run the task from the Schedule options.

  7. Click Save to add the task.

Use Dry Run to test the configuration before clicking Save or select the option on the Cloud Sync Task widget after you click Save. TrueNAS adds the task to the Cloud Sync Task widget with the Pending status until the task runs on schedule.