rdump
Miek Gieben <[email protected]> Sun, 25 Dec 2005 00:36:26 +0100
| Newsgroups | gmane.comp.sysutils.backup.hdup.general |
|---|---|
| Message-ID | <[email protected]> |
--===============1452619600==
Content-Type: multipart/signed; micalg=pgp-sha1;
protocol="application/pgp-signature"; boundary="p4qYPpj5QlsIQJ0K"
Content-Disposition: inline
--p4qYPpj5QlsIQJ0K
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Hello,
[this is the second of two emails]
rdump is an attemp to make unix backups fun and simple again :-)
It currently only compiles on Linux, I've tried FreeBSD, but some
include file is missing and is fails miserably.
The utility rdump is extremely simple. Compiled and stripped it only
measures 9 KB. It was coded in only one day :-). See TODO for what
currently needs to be done.
Below is the README as included in the rdump tarball.
Code and more info available upon request. rdump is licensed under
the GPL. I'm still working on putting rdump online.
README:
-------
1/ TO BUILD
Run: autoconf && ./configure & make
2/ DOCUMENTATION
The manual page explains rdump's options and usage. See rdump(1).
Note: the examples given here are simplified, you cannot use a simple
command, but need to use differentiate between directories, regular
files and symbolic links. See the example script 'bu'.
2.1/ FULL DUMP
Run: rdump FILELIST dir1
Every directory, file and symlink in dir1 will be printed to stdout,
like this:
+16832 1000 1000 bin/.svn
+33152 1000 1000 bin/FILE1
+33216 1000 1000 bin/svnlog
+33216 1000 1000 bin/zlog
+33216 1000 1000 bin/zzz
Which says everything is new, that's the + sign in the first column.
Next to that is the st_mode field of lstat(2), which holds the type
of the file (dir, regular or symlink) and the protection bits.
Then we find the numeric user id and numeric group id. As last
the there is the pathname.
To do a real backup you can use:
rdump FILELIST dir | ./bu /vol/backup/`date +%Y%m`
'bu' (backup) is a shell script which looks at the filetype and
acts accordingly. It copies the content (of the dir/symlink) to=20
the archive directory, it creates a mirror of the actual=20
disk layout of the directories to be backed up.
2.2/ INCREMENTAL DUMP
Just run the rdump FILELIST dir1 | ./bu /vol/backup/`date +%Y$m`
again. This will use the contents of FILELIST and will only print
the changed files.
If we were not piping the output to 'bu' we would see:
-33152 0 0 bin/blaat
+16832 1000 1000 bin/.svn
Saying that 'bin/blaat' is to be removed. bin/.svn is always printed
because that is a directory.
3/ AND NOW FOR SOME FUN
See the note in Section 2. The following are simplified examples of what
is possible with rdump. Look at 'bu' for an example implementation.
You want gzipped backups?
for i in `rdump FILELIST /home`; do
cat $i | gzip -c > /vol/backup/$i
done
You want encrypted backups?
for i in `rdump FILELIST /home`; do=20
cat $i | mcrypt -F -k 'secret' -a blowfish --mode stream > /vol/ba=
ckup/$i
done
You want encrypted/gzipped backups?
for i in `rdump FILELIST /home`; do
cat $i | gzip -c | \=20
mcrypt -F -k 'secret' -a blowfish --mode stream > /vol/backup/$i
done
You want a gzipped tar file of your files?
rdump FILELIST /home > tar_list && \
tar --create --T list -z --file myhostbackup.tar.gz
You want to exclude certain files?
for i in `rdump FILELIST /home | grep -v \*.bak`; do=20
cat $i > /vol/backup/$i
done
You want to include certain files?
for i in `rdump FILELIST /home | grep important`; do=20
cat $i > /vol/backup/$i
done
As in true unix tradition the list can go on and on :-)
--
grtz,
- Miek
http://www.miek.nl http://www.nlnetlabs.nl
PGP Key ID: 3880 D0F6
fingerprint: 6A3C F450 6D4E 7C6B C23C F982 258B 85CF 3880 D0F6
--p4qYPpj5QlsIQJ0K
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
iD8DBQFDrdt6JYuFzziA0PYRAii1AKCxHoDUiFH/M8tLFMdIz7G/ZcUIigCeMny+
U2CiNKy0M2oA0KtyJVt5f9I=
=+0WJ
-----END PGP SIGNATURE-----
--p4qYPpj5QlsIQJ0K--
--===============1452619600==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
hdup-user mailing list
[email protected]
http://atoom.net/cgi-bin/mailman/listinfo/hdup-user
--===============1452619600==--