Over the weekend I wanted to set something up that would sync the files off both my internal and sdcard to my home server. This guide will show you the basics of setting this up. This is not a intuitive guide, but more of “Proof of Concept”, so that you have something to reference while configuring your setup.
- Head over to goodsync.com and download the windows version. After downloading and installing goodsync, you will need to register for a goodsync account. Remember your credentials as you will need them later.
- Create a directory on your linux box for the goodsync services to sit in. `sudo mkdir /opt/goodsync ; chown your-linux-username:your-linux-group /opt/good`
- Now you will need to download the Linux version, http://www.goodsync.com/platforms/linux
- Extract the archive to /opt/goodsync/
- As the user you will be running the server as run…. `/opt/goodsync/gs-server /set-admin=”your-goodsync-userid:goodsync-password:your-linux-username”`
- As the user you will be running the server as run…. Create a directory called fs in ~/.goodsync/server/ .. `mkdir ~/.goodsync/server/fs` .. Now do a symlink to the folder structure you want GoodSync Server to have access too. “ln -s target-path ~/.goodsync/server/fs/target-path
- Log into the webUI (http://server-ip:11000/) and modify the home path for your user to point to the /home/your-linux-user/.goodsync/server/fs/target-path .. Note .. The login is your goodsync account.
- Install app on your Android phone, search the play store for “GoodSync Server”. User your GoodSync username and password. The Third option will be your phone id and you can set it to what ever you want it to be. Just remember it.
- Now create the file ~/.goodsync/jobs.tix … `nano ~/.goodsync/jobs.txt` with the following content. Keep in mind that there is no true documentation that I could find so it was basically just guess work to figure this all out on my end. Another thing to note is that home://S0 = Internal SDCard and home://S1 = External SDCard. You will need to modify the following things: your-phone-id, your-goodsync-user, your-goodsync-password, and fixme(This will need to point to something like: qhome://S0/target-path/Phone_Backup).
Name = "Phone To Local Job (sdcard0)"
Dir1 = <Connect> Url = "gstps://your-phone-id.your-goodsync-user.goodsync/home://S0" UserID = "your-goodsync-username" PasswordClear = "your-goodsync-password" </Connect>
Dir2 = <Connect> Url = "gstps://your-server-id.your-goodsync-user.goodync/fixme" </Connect>
Direction = 0
1wayMode = 0
ReconnectAttempts = 3
TimerIntervalHours = 2
SavePreviousVersion = Yes
CleanupPreviousVersion = Yes
KeepPreviousVersionDays = 7
SavePastVersions = Yes
CleanupPastVersions = Yes
KeepPastVersionsDays = 14
ExcludeEmptyFolders = Yes
AutoResolveConflicts = 3
FiltersExcluded = <FileMask> Matches = ( "/Android" "name .thumbnails" "*thumb*" "name subsonic*" "name /cache/" "/*.log" ) </FileMask>
- After you save that file be sure to chmod 600 it so that no other users can read/write the file.
- Now lets make it so that gs-server starts with your server/desktop. `sudo wget -O /etc/init.d/gs-server https://www.pryorda.net/~irated/gs-server; sudo chmod +x /etc/init.d/gs-server`
- Be sure to update /etc/init.d/gs-server variables. USER_ID, GROUP_ID, EXEC_PATH.
- Verify that the script is working by running `sudo /etc/init.d/gs-server status`. If it is not running go ahead and test the startup by running `sudo /etc/init.d/gs-server start`. It should be running now and you can verify by checking the logs in ~your-linux-user/.goodsync/server/*.log.
- If it is up and running go ahead and run `/opt/goodsync/gsync analyze /all`. Still no errors? Well then run `/opt/goodsync/gsync sync /all`.
- Here is an example of it running successfully.
2013-12-07 14:31:45: gstps://sch-i535.pryorda.goodsync/home://S0 <-> /lan/Phone_Backup/daniel_s3/s0, SavePastVers, bCleanupPastVers=30d, ResolveConflicts=NewerFileWins
2013-12-07 14:31:45: Create Folder '/lan/Phone_Backup/daniel_s3/s0/DCIM'
2013-12-07 14:31:45: Create Folder '/lan/Phone_Backup/daniel_s3/s0/DCIM/Camera'
2013-12-07 14:31:45: Create Folder '/lan/Phone_Backup/daniel_s3/s0/media'
2013-12-07 14:31:45: Create Folder '/lan/Phone_Backup/daniel_s3/s0/media/audio'
2013-12-07 14:31:45: Create Folder '/lan/Phone_Backup/daniel_s3/s0/media/audio/notifications'
2013-12-07 14:31:45: Create Folder '/lan/Phone_Backup/daniel_s3/s0/Ringtones'
2013-12-07 14:31:47: Copy New 'gstps://sch-i535.pryorda.goodsync/home://S0/DCIM/Camera/IMG_20131206_211141.jpg' -> '/lan/Phone_Backup/daniel_s3/s0/DCIM/Camera/IMG_20131206_211141.jpg'
2013-12-07 14:31:47: Copy New 'gstps://sch-i535.pryorda.goodsync/home://S0/media/audio/notifications/facebook_ringtone_pop.m4a' -> '/lan/Phone_Backup/daniel_s3/s0/media/audio/notifications/facebook_ringtone_pop.m4a'
2013-12-07 14:31:47: Copy New 'gstps://sch-i535.pryorda.goodsync/home://S0/Ringtones/hangouts_message.ogg' -> '/lan/Phone_Backup/daniel_s3/s0/Ringtones/hangouts_message.ogg'
2013-12-07 14:31:47: Copy New 'gstps://sch-i535.pryorda.goodsync/home://S0/Ringtones/hangouts_video_call.ogg' -> '/lan/Phone_Backup/daniel_s3/s0/Ringtones/hangouts_video_call.ogg'
2013-12-07 14:31:47: Save State File gstps://sch-i535.pryorda.goodsync/home://S0/_gsdata_/_file_state_v4._gs
2013-12-07 14:31:47: Items Synced OK: 14, Errors: 0
This guide is a Draft and stands to have some corrections made. “Use it at your own risk”. GoodSync documentation sucks right now but is getting better and I’m sorry if it is missing any information. If you have any questions feel free to contact me at https://www.facebook.com/pryorda.