Skip to content
Sync a USB Device with Google Drive
Python
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
env
music_sync
.gitignore
README.md
requirements.txt

README.md

Google Drive Music Sync

A sync utility for Google Drive and your USB Devices

Ideally, you have a bunch of files on Google Drive, and you want to sync them to a USB Device. The current Google Drive client for Mac does not support this- probably for good reason. Google Drive's provided utility is aimed at replicating files that change with your Drive. For example, your My Documents folder might as well be a Google Drive folder.

However, media files are generally read-only. This tool is meant to augment the official Google tool when you have a tiny laptop and a large USB device.

This software is in alpha and may not work as expected!

Modes and Options

There are a few different modes and options that Mass Media Sync supports.

Modes:

Name Usage Definition Implemented?
One Way one-way drive usb drive = drive, usb = drive ∪ usb
One Way w/ delete one-way drive usb -d drive = drive, usb = drive
Two Way two-way drive usb drive = drive ∪ usb, usb = drive ∪ usb Yes!
Two Way w/ delete two-way drive usb -d drive = drive ∩ usb, usb = drive ∩ usb

One Way

Add the contents of one device to the other.

One Way w/ Delete

Replace the contents of one device with the other.

Two Way

Combine the contents of each device onto each device.

Two Way w/ Delete

Remove any content not on all devices from all devices.

Options:

Name Usage Description
Delete -d, --delete Deletes "extra" files. Behavior depends on the mode. See above.
Cache -c, --cache Caches any Drive libraries being synced. WARNING: any changes to cached drive libraries made through the standard Google Drive client will not be reflected upon sync! Use with caution.
Clean Unicode --clean-unicode Some Unicode strings cause issues with creating directories. This will go through and set all file/folder names to their "clean" equivalent.

Set Operations

To provide sync functionality, several set operations are implemented:

Operation Definition Implemented? Test Coverage?
Intersection Elements such that the element exists in both/all sets. Many Partial
Union Elements such that the element exists in any/either set. Many Partial
Subtraction The elements of a set such that no element exists in any/another set. Two Partial

Running PyMusicSync

  • Install requirements from requirements.txt
  • python music_sync/music_sync.py

Currently the Google Drive folder containing your files is hardcoded so you probably want to change it. The directory structure is hard coded as well. I'm working on fixing this eventually to be more abstract.

License: MIT License

You can’t perform that action at this time.