Sync multiple computers to a central server
Amedee Van Gasse
amedee-ubuntu at amedee.be
Thu Mar 17 08:57:17 UTC 2011
On Wed, March 16, 2011 02:19, Derek Maciel wrote:
> I'm a high school freshman, and I edit scripts and such from my school
> computers (which may or may not be the same computer every time), and
> my home computer. All the files will be hosted on my server, and I'm
> trying to find the best method to synchronize these computers using
> minimal bandwidth.
>
> The computers that are involved are:
> * My home computer, which runs Windows 7
> * My school computers, which run Windows 7 and Windows XP
> * My server, which runs Ubuntu 10.04LTS Minimal
>
> About half of the files I work with are hosted on my server's git
> repositories, but not all of them are.
>
> The method I've developed so far is:
>
> On home computer:
> * If files exist, delete them
> * Download up-to-date files from server
> * Edit file, save.
> * Upload to my server
> On other computer
> * If files exist, delete them
> * Download up-to-date files from server
> * Edit, save
> * Upload to server
>
> As you can see, any time I would need to edit a file, I would first
> need to delete it (as I cannot remember every time if I have edited a
> file since the last time I have downloaded the latest version on this
> machine), and then download the latest version.
>
> If it would help, I could build a server in my home that could serve
> as the central backup spot, and have all the other computers sync with
> my home backup server, then have my production server sync with that
> on a cron.
>
> So, does anyone have any suggestions for how to synchronize these
> files optimally? I was going to use rsync but it's a little tough on a
> school computer: I could install software if needed, but it can't
> interfere with anything anyone else would do on the computer (since
> other people would be using them).
You are already using git, and you're talking about scripts. Just put
everything in git.
Every time you edit a script, you first do:
$ git pull origin master
And when you're done, you do:
$ git commit -m 'some meaningfull comment'
$ git push origin master
That way you don't have to worry if you have already edited a script. Git
will do the magic for you.
More details on http://gitref.org/
More information about the sounder
mailing list