using bazaar to backup files over a LAN
Rahul Nabar
rpnabar at gmail.com
Tue Sep 9 03:16:28 BST 2008
On Sat, Aug 23, 2008 at 6:01 PM, John Arbash Meinel
<john at arbash-meinel.com> wrote:
> I would probably just have a checkout on server2 of the repo on server1. Since
> you have bzr on both machines, this can be as simple as:
>
>
> SERVER1$ bzr init-repo --no-trees /srv/server2
> SERVER1$ bzr init /srv/server2/etc
>
> SERVER2$ cd /etc
> SERVER2$ bzr checkout bzr+ssh://server1/srv/server2/etc
> SERVER2$ bzr add files to care about
> SERVER2$ bzr commit -m "Added important files"
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.
> 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)?
> 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?
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"
More information about the bazaar
mailing list