The following is a recipe for a comparison based on filenames alone, not based on file modification times or even content checksums. But it's a start :) Also, the below is to compare two directories that are both on Google Drive, but you can easily adapt it by generating a list of your local files instead with some call to ls
. (So obviously, the below is a recipe for Linux.)
1. Install and configure drive
drive
is a Linux command line client for Google Drive. The easiest is to install it from a package.
After that:
Change into the directory on your computer that includes your whole files synced from Google Drive:
cd /home/user/example-dir/
Initialize drive
with access to your Google Drive. This will ask you to visit a URL and paste the auth code you get there, and save this in a config file in the current directory.
drive init
2. Comparing directories
I found that for large Google Drive folders (36 GiB of small files in my case), starting by comparing directories and fixing cases of missing directories was a good first step. (Also because drive
has no option to copy directories without the files inside between two Google Drive folders. Not a problem if you compare between local and remote files only.)
drive list -directories -recursive -no-prompt -sort name "source dir" > DirDiff.1-source.txt
drive list -directories -recursive -no-prompt -
sort name "dest dir" > DirDiff.2-dest.txt
vim -es +"%s/^\/source dir\///g" +"wq" DirDiff.1-source.txt
vim -es +"%s/^\/dest dir\///g" +"wq" DirDiff.2-dest.txt
The drive
command obtain lists of directories from Google Drive, and the vim
commands remove the differing base directories from each path so that comparison will work properly.
Now to list the directories that are only in the source tree:
comm -23 <(sort < DirDiff.1-source.txt) <(sort < DirDiff.2-dest.txt) > DirDiff.3-missing.txt
And to show the directories that are only in the destination tree:
comm -13 <(sort < DirDiff.1-source.txt) <(sort < DirDiff.2-dest.txt) > DirDiff.4-added.txt
About using comm
like this, see here.
3. Comparing files
This works very similar to comparing directory trees:
drive list -recursive -no-prompt -sort name "source dir" > 1-source-files.txt
drive list -recursive -no-prompt -sort name "dest dir" > 2-dest-files.txt
vim -es +"%s/^\/source dir\///g" +"wq" DirDiff.1-source.txt
vim -es +"%s/^\/dest dir\///g" +"wq" DirDiff.2-dest.txt
To show the files only in the source tree:
comm -23 <(sort < FileDiff.1-source.txt) <(sort < FileDiff.2-dest.txt) > FileDiff.3-missing.txt
To show the files only in the destination tree:
comm -13 <(sort < FileDiff.1-source.txt) <(sort < FileDiff.2-dest.txt) > FileDiff.4-added.txt
Yes, Google Photos can access photos saved in Google Drive. The Google Drive search view in Google Photos displays photos by date, not by the Google Drive folder structure.
From How Google Drive works with Google Photos - Photos Help
View your Google Drive photos & videos in Google Photos
In Google Photos, you can do things like create collages and GIFs,
edit your photos, make movies, and share with people you care about.
You'll see your Google Drive photos and videos in the "Photos" section
of the Google Photos app, but you can also see just your Google Drive
photos & videos using the Google Photos app.
...
Computer
- Go to photos.google.com/search.
- At the bottom right, click Google Drive.
SEE MY DRIVE PHOTOS
Note: If you edit a photo in Google Photos, those edits don't
show in the Drive version of the photo. To have the edited photo
appear in your Drive folder, download the edited photo in Google
Photos and upload it to your Drive folder.
Best Answer
Sure you can by whitelisting which folders you want to sync.
Though, I am not aware of any "blacklisting" approach with Google Drive (i.e "not sync selected folders").
If you're looking for other solutions, you can try some other services such as Bitcasa or BackBlaze.