I suppose it a common way to preserve multiple generations of backup copy of your important data.
To preserve them as much as possible, archiving and compressing the backup copy is one way.
But there is another way to save the storage: hard-linking.
The basic idea is to share the identical files between different generations of backup copy with hard links.
If the target data consist of normal files, rsnapshot does most of the hard-linking management automatically.
But I recently encountered the problem with the database files managed by daemon processes.
Because they are supposed to be changed asynchronously,
the consistency of th
eir copy taken with the cp command is not guaranteed.
Because this kind of problems is often aware in the design of the daemon processes,
special backup methods are provided to export the consistent backup copy.
For example, Subversion provides "svnadmin hotcopy" subcommand, and Trac provides "trac-admin hotcopy" subcommand.
Unfortunately, rsnapshot does not seem to collaborate effectively with these hot backup copy.
Instead, I tried the "hardlink" command provided by the package "hardlink".
The "hardlink" investigates two directories given in its arguments,
comparing the files with the same relative paths.
If they are identical, "hardlink" replaces one of them with the other's hard-link.
For example, on 30 Apr 2012, if you take the subversion's hot copy of /srv/svn/myrepos/ to /srv/backup/20120430/myhrepos,
you give the following command:
svnadmin hotcopy /srv/svn/myrepos/ /srv/backup/20120430/myrepos
Next, to share the identical files with the backup copy of the previous day,
you may give the following command:
hardlink -t /srv/backup/20120429/myrepos /srv/backup/20120430/myrepos
As far as I use, hardlink saves much more disk space than bzip2 compression.
To preserve them as much as possible, archiving and compressing the backup copy is one way.
But there is another way to save the storage: hard-linking.
The basic idea is to share the identical files between different generations of backup copy with hard links.
If the target data consist of normal files, rsnapshot does most of the hard-linking management automatically.
But I recently encountered the problem with the database files managed by daemon processes.
Because they are supposed to be changed asynchronously,
the consistency of th
Because this kind of problems is often aware in the design of the daemon processes,
special backup methods are provided to export the consistent backup copy.
For example, Subversion provides "svnadmin hotcopy" subcommand, and Trac provides "trac-admin hotcopy" subcommand.
Unfortunately, rsnapshot does not seem to collaborate effectively with these hot backup copy.
Instead, I tried the "hardlink" command provided by the package "hardlink".
The "hardlink" investigates two directories given in its arguments,
comparing the files with the same relative paths.
If they are identical, "hardlink" replaces one of them with the other's hard-link.
For example, on 30 Apr 2012, if you take the subversion's hot copy of /srv/svn/myrepos/ to /srv/backup/20120430/myhrepos,
you give the following command:
svnadmin hotcopy /srv/svn/myrepos/ /srv/backup/20120430/myrepos
Next, to share the identical files with the backup copy of the previous day,
you may give the following command:
hardlink -t /srv/backup/20120429/myrepos /srv/backup/20120430/myrepos
As far as I use, hardlink saves much more disk space than bzip2 compression.
Comments
Post a Comment