Backing up a directory to a remote file system [solution]

Jason Clinton me at jasonclinton.com
Thu Jan 29 20:50:25 CST 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jason Clinton wrote:

| I want to perform incremental backups of /pub on a Linux samba server to
| a box on the other side of Kansas City. Some combination involving tar
| looks like the right direction to go but I can't think of a way to have
| tar incrementally compare the files being backed up to the remote
| tarball before the operation begins. I'm not ready to rely on sshfs
| until it is more stable.

Without writing a very disk intensive script, there is no way to have my
cake and eat it to. Here are the two solutions that are inserted in the
the appropriate places in your crontab:

With a single file but not compressed because the -u switch doesn't
allow compression:

On Sunday, 'if test -f /etc/lastbackup.list; rm -f /etc/lastbackup.list;
fi && tar ugf /etc/lastbackup.list
remotebackupserver:/backups/clientname-`date +%U`.tar'
On weekdays, 'tar ugf /etc/lastbackup.list
remotebackupserver:/backups/clientname-`date +%U`.tar'

With multiple files and compression:

On Sunday, 'if test -f /etc/lastbackup.list; rm -f /etc/lastbackup.list;
fi && tar czgf /etc/lastbackup.list
remotebackupserver:/backups/clientname-`date +%U%w`.tar'
On Sunday, 'tar czgf /etc/lastbackup.list
remotebackupserver:/backups/clientname-`date +%U%w`.tar'

Hope everyone had as much fun figuring that one out as I did! :)

Thanks for everyone's help.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFAGXILtSqjk42zvwkRAuxkAJ9K2bSwc+m6PVei0BvehhTL/IuKCgCg1Tgp
vFg/S230TNQ2BppXBDXitT8=
=1o57
-----END PGP SIGNATURE-----




More information about the Kclug mailing list