Cannot figure out how to get Rclone to sync folders on my W10 PC to Google Drive while the folders on GDrive to be encypted?


#21

It seems everything ok. We have only a “nomenclature” problem.

I think we better rename your remotes, it will make more sense.

The encrypted remote “gdrive” points to “secure:Backup”.

I think it makes more sense that the encrypted remote “secure” points to “gdrive:Backup”.

Your rclone.conf file would look like this:

[gdrive]
type = drive
client_id =
client_secret =
service_account_file =
token = {“access_token”:“access_token”:"[edited out]"}

[secure]
type = crypt
client_id =
client_secret =
scope = drive
root_folder_id =
service_account_file =
token = {“access_token”:"[edited out]"}
remote = gdrive:Backup
filename_encryption = standard
directory_name_encryption = true
password = [edited out]
password2 = [edited out]

I changed the names:

[gdrive] <-> [secure]

and:

remote = gdrive:Backup

I just don’t know if this “rename” will affect the encrypted remote and the passwords already chosen (I don’t use google drive as remote), but I think there will be no problems


#22

Now try to sync some files to the encrypted remote:

rclone sync c:\some_small_folder secure:Backup

then see in google drive through the web interface the files created.


#23

FYI rclone can help you do this…

rclone config file

will show you where the config file is and

rclone config show

will show the contents of the config file

rclone config show remotename

will show just the remotename config.


#24

Alright my deepest apologies for late reply, so if I do rclone sync C:\Users\Daniel\Documents secure:Backup my documents folder will by uploaded and synced to google drive, and it will also be encrypted only in google drive right? So my documents folder in my PC will remain the same? Can I do the same thing to my Desktop folder?


#25

Yes, but with the name changes in the rclone.conf file I suggested above.

I don’t know the size of your documents folder, if it is large I suggest doing a little test before, as I suggested:

Yes, they will only be read to be uploaded to google drive. They will not be changed.

Desktop is just a “special folder”, with some formatting features / icons, so the sync command - and any other - can be executed in the same way. However this depends a lot on your use case, how many files you have on the desktop, how often they are modified, etc.

And remember that if you are using the sync command, if you delete a file in your local folder, it will also be deleted on google drive. If this is not the behavior you want, evaluate the copy command (https://rclone.org/commands/rclone_copy). On the other hand using the copy command your google drive will be full of garbage, because the deleted files of your local folder will remain in google drive. It depends a lot on your use case, what you want to do, etc.

If you want your folder on google drive to always be the same as your local folder, and you also want to save a copy of the changed and deleted files, you must use the sync command with the --backup-dir option. The changed or deleted files will be moved to the foder indicated in the --backup-dir option, and the main folder will always be identical to your local folder.

And finally, if you are thinking of uploading multiple folders, direct each one to a destination:

rclone sync C:\Users\Daniel\Documents secure:Backup\Documents

rclone sync C:\Users\Daniel\Desktop secure:Backup\Desktop

#26

Did you understand the logic of encripted remote? They are like an “alias”, pointing to a folder in a “normal” remote.

I suggest using log files (see the --log-file option at https://rclone.org/commands/rclone_sync) so that you can always better evaluate the results of the executed commands.

Another very important suggestion, always use the --dry-run option in your tests.


#27

Alright, I tried syncing a random music folder to my Google drive as a test and I got this error: https://imgur.com/a/ulx6JXQ


#28

Sorry, I just realized that when you posted your rclone.conf file there was a copy-and-paste error and I propagated this error:

token = {"access_token":"access_token":"[edited out]"}

must be

token = {"access_token":"[edited out]"}


#29

Alright I think it’s working now! syncing my documents folder to Google Drive now? So do I have to leave the CMD window open or can I close it? Also does it sync automatically or do I have to be running the command every time I wanna sync?


#30

:grinning::grinning::+1::+1:

Sure! As I said, use a separate destination, an specific folder in google drive for each folder you want to backup:

rclone sync C:\Users\Daniel\Documents secure:Backup\Documents

Yes, have to keep it open.

No, Rclone will not sync automatically as the google drive client does. Each time you want to synchronize your local folder with google drive you will have to execute the rclone sync command. I suggest you create a .bat file (a batch file) and put the rclone sync command there, so you will not have to type it every time.

If you want periodic automatic synchronization, you can use the Windows task scheduler to call this .bat file.


#31

Okay, I’m probably very dumb, but when I do that command, it keeps syncing to the Backup folder not the Documents folder in the Backups folder


#32

Well, I don’t know all the google drive “idiosyncrasies”, but try these other formats:

With \ at the end:

rclone sync C:\Users\Daniel\Documents secure:Backup\Documents\

With /:

rclone sync C:\Users\Daniel\Documents secure:Backup/Documents

rclone sync C:\Users\Daniel\Documents secure:Backup/Documents/

(As I’m using a S3 storage, all of the above formats work - with and without / and \)


#33

This is the one I’d recommend.

I don’t know why the original one didn’t work though - if you do it with -v what does it say @DanielSuarez369 ?


#34

This is what it says


#35

Ok so this is rather weird, even I sync to a different folder all together, it still syncs to the same folder no matter what. Any ideas?


#36

Like look, I made a new folder on my Google Drive called DocumentsBackup, I tried to sync my Documents to the folder, and it still syncs the documents folder to the original Backup folder. https://imgur.com/a/XHKYGaO


#37

You’ve written

rclone sync C:\Users\Daniel\Documents secure:DocumentsBackup

So I would expect the contents of C:\Users\Daniel\Documents to end up in the root of secure:DocumentsBackup

Note that if you want them somewhere else other than the root then you need to specify that

rclone sync C:\Users\Daniel\Documents secure:DocumentsBackup/Daniel/Documents

#38

Ok, but I created a folder in my Google drive named DocumentsBackup and when I do

rclone sync C:\Users\Daniel\Documents secure:DocumentsBackup

It still ends up in another folder in my Google drive named Backup.


#39

No idea why that happens


#40

I’m completely lost. No matter what I do it syncs the folders to the one backup folder in my Google drive.

I saw in my config file that this is there: remote = gdrive:Backup

If I remove the Backup it doesn’t sync at all. I’m lost