Encrypt existing files / plexdrive & crypt question?


I’m just learning about rclyne (tried to read a lot) and I have some questions. I’m on a ubuntu server.

  1. I have a google drive with 4TB files. Is there a way to encrypt the files without having to download/upload them again?
  2. https://github.com/dweidenfeld/plexdrive/blob/master/TUTORIAL.md => This gives me reading rights with plexdrive. Will I need a different mount to upload the files to the google drive since plex drive cannot write? Or can I use the rclone mount that is setup with the howto?

Thank you everybody for helping a starter in linux!


You have to download and upload to encrypt it. One tip is to use Google Compute, they have a $300 free trial. Since its only 4TB you dont need to cap the speed and it should be done in 1-2 hours.

2: Yes you need something in addition to plexdrive for uploades. rclone copy, move or mount. For more advanced users you can also create a union fuse with a read-only plexdrive mount and a rclone mount for a seamless single mount.

Ok, so I used the https://www.andyibanez.com/rclone-encryption-tutorial/ to learn a bit about rclone. I premuse I now have to do the following steps:

  1. google compute
  2. install rclone -> How can I install rclone?
  3. download all the files to the google VPS (?)
  4. rclone crypt files back to my own gdrive and I’m good to go?

If this is ok, then I would need a sort of script for rclone for sickrage .& couchpotato but I’ll try google first :).

2: Just follow the normal rclone install instructions
3-4: You can copy between the two on the fly.

Ok, I think i got it. But now I’m reading about EncFS and that it is faster. I’m currently at a VPS with 4vcores. What should I do? Use rclone with crypt or try my luck at EncFS?

I have to admit, at first glance EnCFS looks like it’s a lot more difficult?

EncFS is more flexible with more application support, but having the downside by being more complex to set up. Personally I’m using Rclone crypt for the simplicity.

Ok, ty. I have everthing set up but now I want to copy the downloaded files to google drive. I have a command like this “rclone copy /home/user/Plex GoogleDriveCrypt:/ --ignore-existing -v --exclude-from /usr/bin/exclude-file.txt” which works BUT I want it to run every 30min. I read in the forum that a script is the way to go. But I have to admit this is again something new for me. Can you advise? Do I need a script or can I put it like this in crontab?

*/30 * * * * rclone copy /home/user/Plex GoogleDriveCrypt:/ --ignore-existing -v --exclude-from /usr/bin/exclude-file.txt

You can do it either way but if you stick it directly in cron, one may execute and take longer than 30 minutes and a new one will execute and you will get multiple running at the same time.

If you want to keep it simple, you can run it out of cron but i’d suggest adding a timeout command to the command line so that it will be terminated before the next one starts as long as you are reasonably sure that each one is expected to take less than 30 minutes:

apt-get install coreutils

*/30 * * * * /usr/sbin/timeout 30m rclone copy /home/user/Plex GoogleDriveCrypt:/ --ignore-existing -v --exclude-from /usr/bin/exclude-file.txt

Alternatively, you could create a script taht would only run the command if it wasn’t previously running or something like that.

also, you really may want to add a logfile option so you know whats happening or capture standard out like this:
*/30 * * * * /usr/sbin/timeout 30m rclone copy /home/user/Plex GoogleDriveCrypt:/ --ignore-existing -v --exclude-from /usr/bin/exclude-file.txt > ~/rclone.log 2>&1

Is there a good reason why you are using ‘ignore-existing’? That tells rclone not even to look at those files and check if they are the same. If you catch a file in the middle of that file being written to, then you can copy half of the file to google drive and the next rclone run will simply ignore it and not check if it was actually complete. without that flag, it will look at the byte size and the time to have a better handle on if that file is complete.

Yeah I had some problems without the ignore existing but I’ll run it this night without it. I already added a config output :).

If I would like to write a small script, how should I start with this? I just want it to check for new files and if there are any files upload them with rclone trough crypt. It doesn’t even have to check for new files but just use copy I guess?

I would let rclone check for new files personally. It does a really good job at it and is pretty efficient.

All the script should really do (barring any other use cases) is check for a running rclone before executing and either terminate it, or exit silently (wait for the next 30 minute run out of cron). If I find some code snippets, i’ll add them.

TY for your support. I think following cronjob will check every hour and stop itself after 55m? Is this a good idea?

0 * * * * /usr/sbin/timeout 55m rclone copy /home/user/Plex GoogleDriveCrypt:/ -v --exclude-from /usr/bin/exclude-file.txt > ~/rclone.log 2>&

I think it looks ok.

Ah I guess encrypting my 20TBs is out of the question then.
This all needed to be done on upload.