# Recommended Backup Method?



## Mike Z (Apr 26, 2017)

I have a small mITX FreeBSD server at home that I use a file server, and nothing more. I have it running a gmirror RAID 1 mirror using two 1TB drives, but I would also like to setup a backup routine for backing up to an external HDD maybe once or twice a week. I have seen articles on using "dump" and "restore" to get a nice block-level backup, but the utility seems odd to use. I've also read some articles that just used dd. I'm pretty unfamiliar with all of these methods, and I'm looking for a simple to use utility that only has to backup at the directory level. Does anyone have any recommendations for backup utilities/methods for FreeBSD?

Thanks!


----------



## CyberCr33p (Apr 27, 2017)

You can use rsync.


----------



## getopt (Apr 27, 2017)

From http://www.wonkity.com/~wblock/docs/html/backup.html


> For copying files or directories, net/rsync is very useful. It only copies the differences between source and target, and supports compression, so updates are very quick. Built-in support for ssh(1) means those directories can be on separate computers on the network. If you wanted to make a backup of selected directories of data files, rsync(1) works extremely well for that, and it’s versatile enough to be used in lots of ways.


----------



## ANOKNUSA (Apr 27, 2017)

dump(8) works pretty well, and is likely to be the fastest option since it's made specifically for backing up UFS filesystems. The real difficulty in using it is that you need to manually manage your incremental backups.

I personally like Borg (archivers/py-borgbackup) It's incremental and deduplicating by design, combining elements of both rsync and tar(1). It's easy to run manually if you're backup drive is only occasionally connected. You can run it directly or through a script via cron(8) to automate creation and rotation of backups. It's written in Python 3, so installing it from ports might be a bit of a hassle if you don't have that set as your default Python version. The Borg project also offers pre-compiled FreeBSD binaries for download, though.


----------



## Oko (Apr 27, 2017)

Depends on what you really want (Journal, Backup, or Archive).  You seems to be using UFS. I only use ZFS at work for storage.

With ZFS these are my recommendations.


You get the Journal by taking regular ZFS snapshots (typically I take them once every hour on lab). Saved us (over 85 people) on multiple instances from accidentally deleted files. I really like sysutils/zfsnap for scheduling snapshots. Note that there is 2.0 version in ports three but for now I am still sticking with 1.xxx branch which we used for several years. It is a shame that FreeBSD doesn't come with simple easy to schedule snapshot tool.

ZFS comes with built in backup tool, ZFS remote replication. You need a second backup server located remotely to backup your file server.  Unfortunately there is no easy way to schedule remote replications (either full or incremental). Those should be triggered by ZFS snapshots. Look at GitHub repo of FreeNAS 9.2.1.9 (the last one root on UFS based). It comes with a wonderful Python script which is called from crontab which schedules snapshot and triggers remote replication including removal of expired replications. It uses clever combination of delta and full remote replications for maximal reliability.  For now I still use some custom scripts I wrote a while ago but it is on my todo list to dissect  mentioned Python script.

Finally for Archiving (in particular smaller amount of data) I like combination of Amazon Glacier and  sysutils/duplicity. Duplicity has its gotchas but it is wonderful tool. I played also with BorgBackup it is in ports under the name py35-borgbackup. It is a wonderful local tool but it is not really suitable for using things like Amazon Glacier.


As of small UFS based home file server I would seriously consider buying a good old tape drive and taking the backup tapes to an offsite storage.


----------



## Mike Z (Apr 27, 2017)

I should have clarified Oko: I am using UFS. Thanks for all of the suggestions guys! I have a few different options to look into now.


----------

