mksnapback
mksnapback is an RC script for FreeBSD.
During system boot, it'll snapshot a given filesystem if a snapshot hasn't
been taken for a configurable amount of time. When the system shuts down, the
script will delete any snapshots that are older than a certain time.
Installation
- Download mksnapback
- Move it to /usr/local/etc/rc.d
- Make it executable
- Add mksnapback_enable="YES" to /etc/rc.conf.
You may add the following variables to /etc/rc.conf:
- mksnapback_directory denotes the directory where snapshots
are placed (and implicitly the filesystem to snapshot). Snapshots are named
like YYYYMMDD, thus if mksnapback_directory is set to
/backup/.snap, you will get snapshots like
/backup/.snap/20150604 and so on
- mksnapback_delete_after defaults to 1 month. Snapshots older than
this will be deleted during system shutdown (refer to date(1) for valid time
expressions)
- mksnapback_create_after defaults to 1 week. A new snapshot will be
taken during system boot if no one has been created for this period of
time.