Search this site


Metadata

Articles

Projects

Presentations

Poor man's backup - becuase incremental backups should be simple

Table of Contents

  1. A simple backup system

A simple backup system

I needed an extremely simple backup system that would allow me to do incremental backups to a remote system aswell as easy recovery. Pmb is that tool. It's crude and simple.

Configuration

You'll need to setup a pmb.rc in /usr/local/etc. You can use the one I have as a reference if you want. Grab it here (pmb.rc). This file should be self explanatory enough.

Once you've configured that file, you can start backing up. Each machine will need it's own pmb.rc in /usr/local/etc.

Usage

  • Backing up:
     pmb -B 
  • Checking backup:
     pmb -C [files] 
  • Recovery:
     pmd -R [files] 

Download

PMB is just a shell script. You'll need the following:

  • a recent version of rsync (2.6.2+ are known to work)
Download pmb 1.0

Hurray.

If you have any comments or whatnot about this, hate or love, lemme know. It works for me, if it doesn't work for you then whatever. Ask and maybe I can help.

Example run

whack(~/projects) [1000] % rm -rf xmlsitebook
whack(~/projects) [1001] % pmb -R xmlsitebook
=>  Checking: /usr/home/jls/projects/xmlsitebook
=>  
=>  Files changed:
=>     usr/home/jls/projects/xmlsitebook/.svn/README.txt
=>     usr/home/jls/projects/xmlsitebook/.svn/empty-file
=>     usr/home/jls/projects/xmlsitebook/.svn/entries
=>     usr/home/jls/projects/xmlsitebook/.svn/format
=>     usr/home/jls/projects/xmlsitebook/.svn/prop-base/Makefile.svn-base
=>     usr/home/jls/projects/xmlsitebook/.svn/prop-base/captainplanet.jpg.svn-base
=>     usr/home/jls/projects/xmlsitebook/.svn/prop-base/layout.png.svn-base
=>     usr/home/jls/projects/xmlsitebook/.svn/prop-base/rit.png.svn-base
=>     usr/home/jls/projects/xmlsitebook/.svn/prop-base/sitebook.xml.svn-base
=>     usr/home/jls/projects/xmlsitebook/.svn/prop-base/sitebook.xsl.svn-base
=>     usr/home/jls/projects/xmlsitebook/.svn/prop-base/testplan.xml.svn-base
=>     usr/home/jls/projects/xmlsitebook/.svn/props/Makefile.svn-work
=>     usr/home/jls/projects/xmlsitebook/.svn/props/captainplanet.jpg.svn-work
=>     usr/home/jls/projects/xmlsitebook/.svn/props/layout.png.svn-work
=>     usr/home/jls/projects/xmlsitebook/.svn/props/rit.png.svn-work
=>     usr/home/jls/projects/xmlsitebook/.svn/props/sitebook.xml.svn-work
=>     usr/home/jls/projects/xmlsitebook/.svn/props/sitebook.xsl.svn-work
=>     usr/home/jls/projects/xmlsitebook/.svn/props/testplan.xml.svn-work
=>     usr/home/jls/projects/xmlsitebook/.svn/text-base/Makefile.svn-base
=>     usr/home/jls/projects/xmlsitebook/.svn/text-base/captainplanet.jpg.svn-base
=>     usr/home/jls/projects/xmlsitebook/.svn/text-base/layout.png.svn-base
=>     usr/home/jls/projects/xmlsitebook/.svn/text-base/rit.png.svn-base
=>     usr/home/jls/projects/xmlsitebook/.svn/text-base/sitebook.xml.svn-base
=>     usr/home/jls/projects/xmlsitebook/.svn/text-base/sitebook.xsl.svn-base
=>     usr/home/jls/projects/xmlsitebook/.svn/text-base/testplan.xml.svn-base
=>     usr/home/jls/projects/xmlsitebook/Makefile
=>     usr/home/jls/projects/xmlsitebook/captainplanet.jpg
=>     usr/home/jls/projects/xmlsitebook/empty.xml
=>     usr/home/jls/projects/xmlsitebook/foo.xsl
=>     usr/home/jls/projects/xmlsitebook/layout.png
=>     usr/home/jls/projects/xmlsitebook/rit.png
=>     usr/home/jls/projects/xmlsitebook/sitebook.fo
=>     usr/home/jls/projects/xmlsitebook/sitebook.ps
=>     usr/home/jls/projects/xmlsitebook/sitebook.xml
=>     usr/home/jls/projects/xmlsitebook/sitebook.xo
=>     usr/home/jls/projects/xmlsitebook/sitebook.xsl
=>     usr/home/jls/projects/xmlsitebook/test.xsl
=>     usr/home/jls/projects/xmlsitebook/testplan.fo
=>     usr/home/jls/projects/xmlsitebook/testplan.pdf
=>     usr/home/jls/projects/xmlsitebook/testplan.xml
This will delete the existing files
Are you sure you want to do this? (y/n) y
Restoring: usr/home/jls/
Restoring: usr/home/jls/projects/
Restoring: usr/home/jls/projects/xmlsitebook/
Restoring: usr/home/jls/projects/xmlsitebook/.svn/
Restoring: usr/home/jls/projects/xmlsitebook/.svn/prop-base/
Restoring: usr/home/jls/projects/xmlsitebook/.svn/props/
Restoring: usr/home/jls/projects/xmlsitebook/.svn/text-base/
Restoring: usr/home/jls/projects/xmlsitebook/.svn/tmp/
Restoring: usr/home/jls/projects/xmlsitebook/.svn/tmp/prop-base/
Restoring: usr/home/jls/projects/xmlsitebook/.svn/tmp/props/
Restoring: usr/home/jls/projects/xmlsitebook/.svn/tmp/text-base/
Restoring: usr/home/jls/projects/xmlsitebook/.svn/tmp/wcprops/
Restoring: usr/home/jls/projects/xmlsitebook/.svn/wcprops/
Restoring: usr/home/jls/projects/xmlsitebook/.svn/README.txt
Restoring: usr/home/jls/projects/xmlsitebook/.svn/empty-file
Restoring: usr/home/jls/projects/xmlsitebook/.svn/entries
Restoring: usr/home/jls/projects/xmlsitebook/.svn/format
Restoring: usr/home/jls/projects/xmlsitebook/.svn/prop-base/Makefile.svn-base
Restoring: usr/home/jls/projects/xmlsitebook/.svn/prop-base/captainplanet.jpg.svn-base
Restoring: usr/home/jls/projects/xmlsitebook/.svn/prop-base/layout.png.svn-base
Restoring: usr/home/jls/projects/xmlsitebook/.svn/prop-base/rit.png.svn-base
Restoring: usr/home/jls/projects/xmlsitebook/.svn/prop-base/sitebook.xml.svn-base
Restoring: usr/home/jls/projects/xmlsitebook/.svn/prop-base/sitebook.xsl.svn-base
Restoring: usr/home/jls/projects/xmlsitebook/.svn/prop-base/testplan.xml.svn-base
Restoring: usr/home/jls/projects/xmlsitebook/.svn/props/Makefile.svn-work
Restoring: usr/home/jls/projects/xmlsitebook/.svn/props/captainplanet.jpg.svn-work
Restoring: usr/home/jls/projects/xmlsitebook/.svn/props/layout.png.svn-work
Restoring: usr/home/jls/projects/xmlsitebook/.svn/props/rit.png.svn-work
Restoring: usr/home/jls/projects/xmlsitebook/.svn/props/sitebook.xml.svn-work
Restoring: usr/home/jls/projects/xmlsitebook/.svn/props/sitebook.xsl.svn-work
Restoring: usr/home/jls/projects/xmlsitebook/.svn/props/testplan.xml.svn-work
Restoring: usr/home/jls/projects/xmlsitebook/.svn/text-base/Makefile.svn-base
Restoring: usr/home/jls/projects/xmlsitebook/.svn/text-base/captainplanet.jpg.svn-base
Restoring: usr/home/jls/projects/xmlsitebook/.svn/text-base/layout.png.svn-base
Restoring: usr/home/jls/projects/xmlsitebook/.svn/text-base/rit.png.svn-base
Restoring: usr/home/jls/projects/xmlsitebook/.svn/text-base/sitebook.xml.svn-base
Restoring: usr/home/jls/projects/xmlsitebook/.svn/text-base/sitebook.xsl.svn-base
Restoring: usr/home/jls/projects/xmlsitebook/.svn/text-base/testplan.xml.svn-base
Restoring: usr/home/jls/projects/xmlsitebook/Makefile
Restoring: usr/home/jls/projects/xmlsitebook/captainplanet.jpg
Restoring: usr/home/jls/projects/xmlsitebook/empty.xml
Restoring: usr/home/jls/projects/xmlsitebook/foo.xsl
Restoring: usr/home/jls/projects/xmlsitebook/layout.png
Restoring: usr/home/jls/projects/xmlsitebook/rit.png
Restoring: usr/home/jls/projects/xmlsitebook/sitebook.fo
Restoring: usr/home/jls/projects/xmlsitebook/sitebook.ps
Restoring: usr/home/jls/projects/xmlsitebook/sitebook.xml
Restoring: usr/home/jls/projects/xmlsitebook/sitebook.xo
Restoring: usr/home/jls/projects/xmlsitebook/sitebook.xsl
Restoring: usr/home/jls/projects/xmlsitebook/test.xsl
Restoring: usr/home/jls/projects/xmlsitebook/testplan.fo
Restoring: usr/home/jls/projects/xmlsitebook/testplan.pdf
Restoring: usr/home/jls/projects/xmlsitebook/testplan.xml
whack(~/projects) [1002] % pmb -C xmlsitebook
Checking: /usr/home/jls/projects/xmlsitebook

No files changed

whack(~/projects) [1003] %