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.  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 another copy of the backup data.  It isn't necessary to list the main backup directory here (the path after -c), and doing that will cause an error.


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


If your dir destination is a local device, like a USB disk, you might 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.


Examples


destname linuxbackup

type dir

dir /mnt/sdb/hashbackup


destname macbackup

type dir

dir /Volumes/HashBackup

Comments