
Use with care! Note the trailing slash on the source folder this is important! A trailing slash on the source folder means to copy the stuff IN the folder into the destination (resulting in "/mnt/DATA2/filesandstuff"). This command will delete files that are missing from the destination, and overwrite duplicates.

You can check what the options do using "man rsync." I don't always use the "-c" option, since it's slow (but more thorough for checking the data). Sudo rsync -c -r -t -p -o -g -v -progress -delete -l -s /mnt/DATA/ /mnt/DATA2
#Grsync export as rsync script download
It supports (so far as I can tell) ALL the same options as rsync (glee!), and lets you do it with Google Drive! You can upload to, and download from GD in this way, by picking which to use as SOURCE/DESTINATION folders.įirst, go here and follow the installation instructions:ĭo not neglect the bit about authenticating!! If you do, none of the gsync stuff, below, will work!įor reference, here's the command I use to backup my stuff between my LOCAL hard drives-from "/mnt/DATA/" to "/mnt/DATA2": In short, the answer is to use "gsync" (NOT "grsync", which is different and broken/incomplete). It took me a while to find a good, simple, reliable way to backup my stuff to Google drive, using rsync so I've decided to share my method with the good people at LQ. (All of your rclone commands belong on lines AFTER the first, each on separate lines.) Then save the file, make it executable (as above), and run it from the command line or double-click it in a GUI environment (like KDE, Gnome, XFCE, etc.). Refer to the documentation for instructions specific to each cloud.įinally, if you want to backup a whole lot of directories in an automated fashion, write out a bunch of these commands-one for each directory to backup-and put it into a text file starting with "#!/bin/bash" or "#!/bin/sh" on the first line. (THIS IS DANGEROUS, AND WILL ERASE YOUR LOCAL DATA!) Also, you can transfer data from one place on remote storage to another place on remote storage using the same method: "rclone ". If you want to put everything from the remote drive onto your computer, erasing old files on your local machine, and replacing them with newer ones from the remote source, just put the source-the remote storage location-first in the command and put the destination-your local machine-second. Note the the trailing slash on the source but not the destination (see below, in the gsync section). "-v" provides you with information about what the program is doing, while it executes, and is optional. This will put all the stuff from "/" into the Google Drive folder called, "MyBackupFolder/", creating subdirectories as needed. Rclone sync "/" "drive:/MyBackupFolder/" -v So, instead, format the command like this: However, you probably don't want to execute the command in exactly this way, unless you want all your data to dump into the root folder of the remote location (like a tar bomb). This will upload everything once, then only upload changes (like rsync does), later on. The most basic (but probably not very desirable) way to put all the stuff from one directory on your computer onto Google Drive, overwriting older versions, is to do this: Follow the instructions! If you run into trouble, go here: When you run "rclone config", you will get to pick a name and type for your remote storage medium (referred to as "drive" in this HowTo), and it will ask you to do a few steps to authenticate with your Google account. If you choose to do the latter, remember to make your shell script executable with "chmod +x ", or by using your preferred desktop environment's Properties dialogue. Like gsync, this is a command-line program, so you will need to either run it from the terminal or write a shell script (BASH/SH recommended) to make it do what you want via a double-click. Decompress the file and either run it from the directory it creates or copy it to somewhere in your PATH, like "/usr/local/bin/" and run it from any location on the command-line. Download the appropriate file for your operating system and architecture. It's worth noting that, although this HowTo is Google Drive-specific, rclone works with about a dozen cloud storage services, including Amazon S3 and Dropbox.

This Linux user has had good experiences with rclone. 12 2016: The gsync project has had some problems with show-stopping bugs, so you might want to try using rclone, instead. (Thanks to mostlyharmless for this info.) If this is a concern for you, but you want to upload to Google Drive, anyway, please consider using some of the encryption methods mentioned here (or another encryption method of your choosing): DISCLAIMER: Uploading to a cloud storage system implies that you trust the maintainers of that system and everyone in-between to not mess with/read your data.
