English | Japanese
pdumpfs: a daily backup system similar to Plan9's dumpfs
Last Modified: 2004-07-13 (Since: 2001-02-18)
What's pdumpfs?
pdumpfs is a simple daily backup system similar to Plan9's dumpfs which preserves every daily snapshot. pdumpfs is written in Ruby. You can access the past snapshots at any time for retrieving a certain day's file. Let's backup your home directory with pdumpfs!
pdumpfs constructs the snapshot YYYY/MM/DD in the destination directory. All source files are copied to the snapshot directory for the first time. On and after the second time, pdumpfs copies only updated or newly created files and stores unchanged files as hard links to the files of the previous day's snapshot for saving a disk space.
- 2004-07-13: pdumpfs 1.1 Released!
- A bug in error message handling was fixed.
- Some small modifications were also made.
- 2004-06-22: pdumpfs 1.0 Released!
- 2004-05-11: pdumpfs 0.9 Released!
- Some bugs were fixed including "unexpected next" bug.
- A Windows binary is now available experimentally using
Exerb.
- 2004-03-31: pdumpfs 0.8 Released!
Ruby 1.6 is now supported again (pdumpfs 0.7 doesn't work with ruby 1.6)
- 2004-03-30: pdumpfs 0.7 Released!
- Win32/NTFS file system is now supported.
- --exclude option is now supported.
- Thanks to Takeshi Komiya
for the patches.
- Some small bugs were also fixed.
- 2001-02-19: pdumpfs 0.1 Released!
This is a screenshot of pdumpfs working on Windows XP.
Installation
To install pdumpfs from the source code, unpack the package
and run make
and copy the resulting
pdumpfs
file to your bin directory such as
/usr/local/bin
.
Usage
Command Line
% pdumpfs <source directory> <destination directory>
Example
To backup your home directory /home/yourname to /backup, run the following command.
% pdumpfs /home/yourname /backup >/backup/log 2>/backup/error-log
On and after the second day, it is a good idea to invoke the backup command with cron daemon. The following setting allows you to backup your home directory every 5 a.m.
00 05 * * * pdumpfs /home/yourname /backup >/backup/log 2>/backup/error-log
If the backup system works well, you can retrieve a certain day's file with a file name like /backup/2001/02/19/yourname/...
Excluding Files
To exclude particular files from a backup,
you can use the following options.
- --exclude=PATTERN
- Exclude files or directories matching PATTERN (Regular Expressions in
Ruby) from a backup. You can specify the option as many you like.
- --exclude-by-size=SIZE
- Exclude files larger than SIZE from a backup. You can
specify SIZE like 100, 100K, 10M, and 1G.
- --exclude-by-glob=GLOB
- Exclude files matching FILE from a backup. fnmatch(3)
(shell globbing) to the basename of a file is used for matching.
You can specify the option as many you like.
Examples
# Exclude files and directories matching "spool" or "log" from a backup.
% pdumpfs --exclude 'spool|log' /var /mnt/backup
# Exclude files larger than 10MB from a backup.
% pdumpfs --exclude-by-size 10M ~/ /mnt/backup
# Exclude wave files (*.wav) from a backup.
% pdumpfs --exclude-by-glob "*.wav" ~/ /mnt/backup
Limitation
- pdumpfs can handle only normal files, directories, and symbolic links.
- pdumpfs may not work on systems other than UNIX because pdumpfs utilizes hard links.
- pdumpfs is not suited for a directory containing large files which update frequently.
- If more than 31 days absence occurs, incremental backup would not be performed. So, backup your files everyday.
- With pdumpfs, you can easily remove unnecessary files because the past files can be retrieved at any time. However, please do not put too much confidence in pdumpfs. pdumpfs may have serious bugs.
Tips
- If files are increased by 10 MB everyday, about 4 GB disk space is consumed by one year. It is not too much, considering the recent evolution of computer resources.
- Backup your files to a physically separated device.
- With a linux ext2/ext3 filesystem, files can be immutable with chattr command. To make all files in /backup immutable, run
chattr -R +i /backup
with the root privilege. chattr command keep you from doing rm -rf backup files by accident.
pdumpfs is a free software with ABSOLUTELY NO WARRANTY under the terms of the GNU General Public License version 2.
Links
Satoru Takabayashi