Menu

Backyard Pi Google Drive

Overview

Security

Configuring the Pi

Create an rclone config

To create an new rclone remote as the motion user, execute:

sudo -H -u motion rclone config

choosing Google Drive as the backend and answering the prompts appropriately. (Do not configure as a ‘Shared Drive (Team Drive)’).

If you are running ‘headless’ (that is without graphical interface and can’t use a browser on the Pi) you will need to follow the instructions for remote authorization, which requires you follow the link provided by rclone on a computer with a browser and to copy the resulting authorization code back into the config prompt on the Pi.

Add a copymotion script

A copymotion script for copying to a remote web server directory when using the above autocopy configuration in /etc/motion/motion.conf

Copy this script to /usr/local/bin/copymotion

#!/bin/sh

( rclone copy /var/lib/motion/data google-drive-motion:/motion & )

NB This script assumes you have configured the destination for videos and photos to be /var/lib/motion/data NOT /var/lib/motion (which is the default). This is because the rclone config lives in /var/lib/motion/.config and we do not want to copy it to a public Google Drive folder.