using bazaar to backup files over a LAN
John Arbash Meinel
john at arbash-meinel.com
Tue Sep 9 17:27:15 BST 2008
-----BEGIN PGP SIGNED MESSAGE-----
Rahul Nabar wrote:
> Can I do this at root dir level instead? That way I can version
> config-files , make-files etc. from various locations (/etc /opt and
> so on) from a single repo. Something like:
> SERVER1$ bzr init-repo --no-trees /srv/server2
> SERVER1$ bzr init /srv/server2/
> SERVER2$ cd /
> SERVER2$ bzr checkout bzr+ssh://server1/srv/server2/
> SERVER2$ echo '*' > /.bzrignore
> SERVER2$ bzr add /etc/foofile /var/lib/barfile
> SERVER2$ bzr commit -m "Added important files" /etc/foofile /var/lib/barfile
> Any pitfalls/ blunders in the above "conversation"? I am aware that
> bzr add * will no longer work on entire dirs and I will be forced to
> add each set of files I want to version individually.
> Also, the ssh connection will work even if the passwordless logins are
> *disabled*, right? We require a password for jumping from SERVER2 to
> SERVER1 for security purposes.
I don't see a specific reason why it wouldn't work. Though the same
caveats (permissions aren't directly tracked, etc) still apply.
'passwordless logins are disabled'? So you have to supply a password? As
long as you can do 'ssh SERVER1' then things should be fine.
>> If the network is *really* good, you could even change that to "bzr checkout
>> - --lightweight", which will only keep enough information to manage what files
>> are versioned, and everything else will reside on SERVER1.
> Let's say I lose both the versioned files and the bazaar files on
> server2 (not backed up) will I still be able to regenerate from the
> info on server1 (backed up)?
If you use a plain "bzr co bzr+ssh://server1..." then everything
committed on server2 will be stored on server1. So if server2 completely
dies, you should still have everything (committed) on server1.
>> The other thing is you may want to play with "bzr ignore" in case you don't
>> want to version specific files. Personally, I set up my etc by ignoring a few
>> files and then adding almost everything.
> I was thinking of having a * in my .bzrignore and only manually adding
> each file I wanted versioned by a bzr add foofile; bzr commit foofile.
> Oh, my .bzrignore can lie at the / of SERVER2, right? Or on server1?
.bzrignore is always at the root of the working tree, so if you are
versioning from '/' then it will always be there.
> Plus a crontab hack for a automatic daily update of whatever has
> changed from amongst the versioned files:
> /usr/bin/bzr commit -m "bzr cron automated daily commit" ~/ 2>&1 |
> mail -s "bzr cron automated commit" "foo at bar.edu"
That may work, but I don't see how you get around the "requiring a
password for security reasons".
The way I would do automated work is by having an ssh key allowed from
server2 => server1 (possibly restricted). You can give it a password,
but then also run an ssh-agent. So when the machine boots, you have to
load the ssh key into the agent, before the cron script can run
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----
More information about the bazaar