Destinations‎ > ‎

Directory

A dir destination specifies a filesystem directory where HashBackup should write copies of the backup.  The directory can be on any type of filesystem since HashBackup doesn't depend on special capabilities on destination filesystems.  NFS, FAT, SMB/CIFS, SSHFS, WebDAV, Google Drive, Dropbox, etc. should all work fine.  Backed up file system metadata like hard links, extended attributes, ACLs, and file modification times will still be saved and restored correctly, even if the destination filesystem does not support these features.


A dir destination is used to make a copy of the backup data.  Do not repeat the main backup directory here (the path after -c) as that will cause an error.


The destination directory must already exist: HashBackup will not create it automatically.


If your dir destination is a device that physically seeks (moves disk heads), like a USB hard drive, you'll probably see better performance by setting workers to 1.  With the default workers (2), there will be 2 simultaneous copies to the USB disk, potentially causing seeking back and forth between them.  With 1 worker, backup files are copied sequentially with very few seeks.


Rotating USB Sticks Or Hard Drives


An easy and efficient backup strategy is to rotate drives, keeping one onsite and one offsite.  To backup to several different USB sticks or hard drives in rotation, list each drive in dest.conf as a type dir destination with a different destname and mount point (the dir keyword value).  If only one of the sticks/drives is inserted, you will get errors for the missing drives, but when you swap drives for the next backup, HashBackup will copy all missing files to "catch up" the drive.


When rotating drives, you can either:


1. Leave cache-size-limit at -1 so that there is a complete copy of the backup in the local backup directory.  This allows you to have none, 1, or both USB drives inserted at backup time, and whatever drives are inserted will be "caught up".


2. If cache-size-limit is set >= 0, there is only a partial copy of the backup in the local backup directory.  When swapping in a new drive, it first must be "caught up" with both drives inserted.  To do this, insert both drives and run the hb dest sync command.  Then continue backups with only 1 drive inserted.


Multiple Directories


The dir destination explained above uses a dir keyword to indicate the single directory where all backup data is copied.  A  variation of the dir destination with type "dirs" allows specifying multiple destination directories.  Backup data is distributed over this set of directories.  This is useful with multi-drive external disk enclosures configured as JBOD (Just a Bunch Of Disks).  It is possible to configure these units as one large RAID0 drive and use a "dir" destination, but that reduces reliability: if any disk fails, all data is typically lost.  A RAID > 0 configuration is most reliable, but also reduces capacity. A JBOD configuration using the dirs destination type with multiple directories is a middle ground: if a disk is lost, only the backup data on that drive is lost.  This is an especially reasonable configuration if you have another copy of the backup data at another destination.

The dirs destination requires a dirs keyword specifying multiple target directory paths, separated by colons.  When reading from the destination, HB will check all directories until it finds the file it needs.  When writing arc files, HB will check available space in each directory and copy to a directory with enough space to hold the file.  When copying non-arc files, HB makes copies in every directory that has room, to increase the chances of a recover in case the local backup directory is lost and one or more JBOD disks are also lost.

The "copies" keyword specifies how many copies of arc file to create, to increase redundancy.  The default is 1.

The "spread" boolean keyword causes arc files to be distributed over all disks rather than filling up disk 1 before using disk 2.  Using spread by itself will enable the feature.


IMPORTANT NOTE: the directories listed with the dirs keyword should each be on separate physical disks.



Single Directory Examples



destname linuxbackup

type dir

dir /mnt/sdb/hashbackup



# use larger I/O for NFS synchronous writes


destname macbackup

type dir

dir /Volumes/NFStarget

iosize 16M



Multiple Directory Example


destname linuxbackup

type dirs

dir /mnt/sdb/hb1:/mnt/sdb/hb2:/mnt/sdb/hb3:/mnt/sdb/hb4

spread

copies 2


Comments