A private alternative to Dropbox for windows

(Note: this is an old post that got lost in the web host move, but its still mostly valid.)
I seem to have a love-hate relationship with dropbox. one one and i love the idea and the functionality of it. on the other hand, i dislike that my files are on someones elses server. (or ‘cloud’, depending on how much you like buzzwords)

So, with this in mind ive come up with my own alternative to dropbox. while the initial setup may seem a bit clunky, the final setup seems to work well in terms of functionality. This setup is only for windows right now, im sure there are some other decent methods for linux and/or mac systems online somewhere, I didnt find any decent windows ones.

what you will need.

ExpanDrive (from http://www.expandrive.com, not free, but there is a trial)
PureSync (from http://www.jumpingbytes.com/en/puresync.html, the personal edition is free)
a VPS or Home Server (you can find some good deals on http://lowendbox.com )

Lots of highspeed bandwidth, both up and down is a bonus, to make things go a little faster!

Firstly, im assuming you have already setup the security for the server or VPS your going to use, if not, do that now, also, make sure there is an SSH server installed n the OS. at this point you may choose to make a seperate user to use when you log into the server via ssh, it adds a little extra security as you can then set permissions on what that user can access. once thats done there isnt much else left to do on the server except remember the ssh login details that you will use to login to the server. you can choose to define to folders over ssh to share now or you can do it later.

Now to setup the software on the client machines, repeat this procedure for all of the machines you wish to share files with.

install ExpanDrive. once installed, open the drive manager and fill in the correct information. choose a name for your drive and type it into the drive name box. if you have a domain associated with your server you can type this nto the server box, otherwise type in the IP address of the server. (note if your using this setup on a home server thats connected to a router, make sure you forward a port for it! you can find out more about port forwarding at http://www.portforward.com.) type in the username and password of the user you use to login to your SSH server. from the authentication list, choose “use a password to log in”, if you have setup public-key encryption you can also use this to login to your server. in the directory dropdown box you can choose which directory is your main root directory on the server for sharing. then in the drive letter box, choose a drive letter for the drive that will appear in “My Computer”. to have this run of startup you can tick the box that says reconnect at logon, that way you will always be connected to your shared folder. click connect and the software should connect to your server and create a drive in “my computer”. you can now go into the newly setup drive, and start creating folders for sharing, some advanced sharing techniques are at the end of the article if you want some interesting ideas on how to expand functionality with this setup.

Thats half of it done! now to setup the syncing part!

first, install PureSync. once installed you need to setup some folders to sync. for example i sync my wallpapers folder to the server, i also have the same setup running on my laptop, this means the desktop and the laptop share from the same wallpapers folder. you can do similar things with some program configurations and other things like favorites etc. to setup a new sync, from the main window, choose “new syncronization”, choose the folders you want to sync; on the left hand side choose a folder on your local drive. on the right hand drive choose a folder you’ve defined for sharing from your ExpandDrive connected drive. click next, and the sync should start. an important setting to change on each sync job is for it to monitor its sync folders. once the initial sync is done, click “home”, then choose the sync job in the right hand box and click settings, this is where you can change the sync setting to make it monitor the folder. click auto sync nthe left hand side and check the box next to “when a file has been modified, i chose 2 seconds as the time to start the sync after. click ok and the settings will save. when you close the program it will minimise to the system tray. now if you put a file into one of the synced folders it will automatically be uploaded to the server, if there is another machine with the same setup on, this file will now be synced with that machine/device too!

thats all there is to it for the basic setup. but there are some advanced things you can do to add functonality. for example, if you wanted to have a publicly shared folder with http links, you could install a webserver on the server and configure it so the public directory is a folder you’ve defined for public sharing within expandrive. just make sure to remember it is public so dont put anything private there!

When i have the time i will update this guide with some pictures, have fun! :)

Rsync tips

So ive recently been stufying rsync mauals and guides etc because im using it to backup up a webserver, so i thought i’d post a few tips that have helped me be less confused about the whole thing, when it comes to error messages etc :p

The destination folder on the remote server must be owned by remote user account that is being used to login via rsync, chmod permissions must also be at least write, 775 (for folders) & 644 (for files) is probly the best idea.

It doesnt matter what user is running rsync on the local system (rsync doesnt have to run as root on the local system, it only has to have read permissions to the files it wants to send via rsync), usernames do not have to be the same.

The only thing that matters is that the remote user account that is being used to login via rsync has read/write permissions to the appropriate directories.

its not required but if your doing a full system backup of / it might be a good idea to run rsync as root as it might not have read access to all the files if it doesnt run as root. (yes i know this probably sounds like a bad idea, but its just a thought :p i havent tested doing a full system backup yet).

When the files have been copied the owner and group will be changed to that of the remote user account that has been used to login via rsync, time stamps will remain as they were on the system they were sent from.

Source folders may be be owned by root or any user and they will still copy as long as read access is available to rsync. 

AFAICT Best practice is (if possible):

chmod folders to 0755
chmod files to 0644

this also applies to destination directories, this means that rsync will actually copy the files instead of giving permission errors.

Syntax tip: When copying via rsync the trailing slash on the source directory indicates that it will only copy the contents of the folder. without the trailing slash rsync will also copy the directory name as well as the contents.

I also found these links to be handy:

http://amountaintop.com/rsync-non-standard-ssh-port

http://www.linux.com/archive/feature/113847

ok, thats all I have :) have fun :p