No frikin tables...
Friday 30th 2010f July 2010 01:33:41 PM

Work Synchronisation Script

I have been trying to find a way of backing up my work, from the univerisities filestore, to my Laptop, or Server. After trying out a number of different programs i've decided to use rsync to synchronise the universities filestore with my server's account. I also installed rsync in my laptop, and i synchronise between my laptop and server.

The way this works is that when i login into my universities account, i run an UpdateWork.sh script. Which updates all the files inside the ~/Work directory with my ~/Work in my server. Then when i finish working, i then run an UploadWork.sh script which does the opesite, synchronises my server's ~/Work with the uni's ~/Work. Me being lazy, and very forgetful, i setup openbox todo this automaticly, every time i login and everytime i press the exit button on the menu. I've created RSA ssh id's, that allow me to use ssh-agent to lgin without typing in a password.

I'll try and improve these scripts, to include either cvs or subversion concurrent backup feature, along with rsync. This will allow me to go back and get a previous version of a file. Also these files are just source codes for java, or normal documents. So therefore they won't get too big. I also leave these scripts inside my ~/Work folder. So when ever i change something, my server, uni and my laptop, they all get updated, when i run the script. So this works nicely.

Ofcourse this really breaks down if you forget to Upload the new files, or something. eg: in uni i started the UpdateWork.sh script. Then i created new files, etc etc. Then the Upload script did not work and openbox exited too quickly. Now when i relogged in again, the update script started. Therefore it erased all the new files that it found on the ~/Work directory. So be careful. I'll try and improve it in the future.

These scripts also works on windows, i mean if you use cygwin, and install rsync with it. Then this works just fine. It works the same was as it does on Linux.
UpdateWork.sh View Download
UploadWork.sh View Download