LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Rsyncing to Google Drive Using google-drive-ocamlfuse (https://www.linuxquestions.org/questions/linux-newbie-8/rsyncing-to-google-drive-using-google-drive-ocamlfuse-4175616378/)

scottm7 10-25-2017 12:17 PM

Rsyncing to Google Drive Using google-drive-ocamlfuse
 
I'm using google-drive-ocamlfuse to copy files to Google Drive. I'm using the following Bash Script to do it. It is very slow but I'm sure that's primarily because of the connection. The first run is copying 490 GB. I'm trying to get a good start on it so it will be done in a couple of weeks or less.

I tried using the parameters rlvW. I saw those at: https://github.com/astrada/google-dr...use/wiki/rsync. It seemed really slow so now I'm using azvW.

Does anyone have any advice here or is azvW good enough? I'm new to google-drive-ocamlfuse and I've been using the same rync over and over for my regular drive with azuv.

Thanks!

Quote:

#! /bin/bash
drives=("wdgld6" "wdblk6" "wdred3" "wdblk1" "gdrive")
for i in "${drives[@]}"
do
if [ -d /run/media/user01/$i/backup/ ]; then
echo '--> STARTING '
echo '--> STARTING ' $i $i $i $i $i $i
echo '--> STARTING '
echo $(date)
# VERBOSE = -v
# rsync -azu --exclude 'do-not-sync' --delete
# rsync -azu --delete
folders=("Documents" "Downloads" "Music" "Pictures" "Templates" "Videos")
for f in "${folders[@]}"
do
if [ ! -d /run/media/user01/$i/backup/$f ]; then
mkdir /run/media/user01/$i/backup/$f
fi
echo '--> STARTING '
echo '--> STARTING ' $i $f $f $f $f $f
echo '--> STARTING '
if [ $i = "gdrive" ]; then
rsync -azvW --inplace --size-only --delete /run/media/user01/wdgld6/backup/$f/ /run/media/user01/gdrive/backup/$f/
else
rsync -azuv --exclude-from='/media/user01/Documents/linux/rsync-exclude.txt' --delete-excluded --delete /media/user01/$f/ /run/media/user01/$i/backup/$f/
fi
echo '--> FINISHED '
echo '--> FINISHED ' $i $f $f $f $f $f
echo '--> FINISHED '
done
fi
echo $(date)
echo '--> FINISHED '
echo '--> FINISHED ' $i $i $i $i $i $i
echo '--> FINISHED '
i=$(($i + 1))
done

TB0ne 10-25-2017 12:36 PM

I'd avoid rsync totally using Gdrive and the ocaml-fuse solution. Done that before, and rsync was the cause (unproven, but speculation) of the slower speed. Use rclone instead
https://rclone.org/install/

scottm7 10-25-2017 12:43 PM

Wow! That seems to be much faster. It's already copying quite a few files.

Should I run this command the second time or something else?

rclone copy /run/media/user01/wdgld6/backup/$f/ /run/media/user01/gdrive/backup/$f/

TB0ne 10-25-2017 12:50 PM

Quote:

Originally Posted by scottm7 (Post 5773773)
Wow! That seems to be much faster. It's already copying quite a few files.

Should I run this command the second time or something else?

rclone copy /run/media/user01/wdgld6/backup/$f/ /run/media/user01/gdrive/backup/$f/

Depends on what you're trying to accomplish. Run "rclone --help", and explore the sync vs. copy option.

scottm7 10-25-2017 12:59 PM

For those of you coming to this thread at a later date, the above suggestion didn't end up working for me but that doesn't mean it won't for you. I'm currently backing by uploading the files to Google Drive using the web browser. At it's current rate it should finish in 2 weeks. I'll then explore how to sync making the data on Google Drive identical to the data from the source.

scottm7 10-27-2017 12:34 PM

For those of you who do a web search for netbrake or trickle for grive or grive-tools and end up here - this is what worked for me:

I adjusted download and upload several times before I got it. Sync has to find out what needs to be transferred and that can take awhile. I probably don't need such a low limit on the download side especially because right now I'm just trying to get the 490 GB up there the first time. I was bottlenecking in the upload Kbps.

trickle -vs -d 450 -u 450 /opt/grive-tools/grive-indicator

On gnome-system-monitor I saw before where it was a flat line for the upload rate but now it looks like a cosine.

I may adjust the download rate later and remove verbose but for now it's working great!


All times are GMT -5. The time now is 09:34 PM.