siom79 / jdrivesync

jdrivesync is a simple command line tool that synchronizes a local file system structure to your Google Drive (and back)

Home Page:https://siom79.github.io/jdrivesync/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

2-ways sync

chungyan5 opened this issue · comments

It will be nice to have 2-ways sync. In my case, I will operate my photos in my ubuntu computer, and do not know when will my mobile sync any new photos to google drive. I am afraid a 1-way sync(upload of new content from my ubuntu to google drive) will erase my random upload photos from my mobiles.

Hi,
you can create a shell script with following commands:
java -jar jdrivesync.jar --up --no-delete -l "/source/" -r "/target" -i
jdrivesyncignore
java -jar jdrivesync.jar --down --no-delete -l "/source/" -r "/target"
-i jdrivesyncignore
This will synchronize your hard drive with Google drive without deletion.
Regards,
Ondřej


Předmět: [jdrivesync] 2-ways sync (#15)
Datum: 12.2.2016 19:03:22
Od: Cheng Chung Yan
Komu: Siom79/jdrivesync

It will be nice to have 2-ways sync. In my case, I will operate my
photos in my ubuntu computer, and do not know when will my mobile sync
any new photos to google drive. I am afraid a 1-way sync(upload of new
content from my ubuntu to google drive) will erase my random upload
photos from my mobiles.


Reply to this email directly or view it on GitHub
#15.

Thanks your comment,

I am greedy as i want my modified contents and removed mess photos at my ubuntu computer can upload to google drive as well, if "--no-delete", that means it will not remove the removed mess photos inside google drive.

I had the same problem. I use openSUSE, but I think you will have an option to run certain programs after startup of Ubuntu system, too. I have created a shell script and called it after successful logging to my system. Perhaphs it could work for you, too, but you will have to adapt it to your system and paths. Here is the script:

#!/bin/bash
#Synchronizing with Google Drive
sleep 2m
cd /home/[user]/Applications/jdrivesync
rm jdrivesyncReport_.html
java -jar jdrivesync.jar --down -l "/[target folder on hard drive]" -r "/[source folder on Google Drive]" -i jdrivesyncignore --html-report
konqueror jdrivesyncReport_.html

This script wait for 2 minutes before internet connection is ready and then synchronizes all files from Google Drive to local drive (including deletions). Finally it opens synchronization log in Konqueror web browser. Another script I call when shutting down the system:

#!/bin/bash
#Synchronizing with Google Drive
cd /home/[user]/Applications/jdrivesync
rm jdrivesyncReport*.html
java -jar jdrivesync.jar --up -l "/[source folder on hard drive]" -r "/[target folder on Google Drive]" -i jdrivesyncignore --html-report

Usually, when you work with computer, you are probably not making photos, so I assume there should be Google Drive syncing down to your hard drive after logon. If you make some changes in local files, they could be synchronized up to Google when you are logging off. At least this procedure worked for me.