TrueNAS SCALETrueNAS SCALE Version Documentation
This content follows the TrueNAS SCALE 23.10 (Cobia) releases. Use the Product and Version selectors above to view content specific to different TrueNAS software or major version.

Adding a Google Photos Cloud Sync Task

  4 minute read.

Last Modified 2024-03-19 08:38 EDT

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.

Enable API

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

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

Configure Authentication

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

Enter a value in App name and User support email.

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

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

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

You can leave the app in testing mode, but configured cloud sync tasks fail 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.

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

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

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.

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.

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.

Adding Google Photos Cloud Credentials

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

Select Google Photos as the Provider and enter a name.

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 Add Cloud Sync Task configuration screen opens.

  1. (Required) Type a memorable task description in Description.

  2. Select an existing backup credential from the Credential dropdown list. If you have not added the cloud credential, click Manage Credentials to open the Backup Credentials screen.

  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. A Bucket field also displays for some cloud providers.

  4. Select the dataset location in Directory/Files.

  5. Cloud provider settings change based on the credential you select. Select or enter the required settings that include where files are stored.

  6. Select the time from the Schedule options.

  7. Click Save to add the task.

You can use Dry Run to test your configuration before you click Save or select the option on the Cloud Sync Task widget after you click Save.