BSD Ports

filesystems/zfsnap 1.11.1_1 FreeBSD

Simple sh script to make zfs rolling snaphosts with cron

System
FreeBSD
Repository
FreeBSD ports
Maintainer
[email protected]
License
BSD3CLAUSE
Categories
filesystems, sysutils
Package size
7.4 KiB, 25.0 KiB installed

Description

zfSnap is a simple sh script for creating ZFS snapshots. When called from cron rolling snapshots can be created and deleted automatically. The main advantage of zfSnap is that it is written in 100% pure /bin/sh, does not require any additional software to run, and is simple to use.

zfSnap keeps all information about snapshot in snapshot name. zfs snapshot names are in form: Timestamp--TTL where timestamp is date and time of snapshot creation and TTL is Time To Live in human readable form.

In the other systems

SystemPortVersion
FreeBSDfilesystems/zfsnap1.11.1_1
DragonFlyfilesystems/zfsnap1.11.1_1
MidnightBSDfilesystems/zfsnap1.11.1

Install

Binary package:

pkg install zfsnap

From the ports tree:

cd /usr/ports/filesystems/zfsnap/ && make install clean

To depend on this port in another port's Makefile:

RUN_DEPENDS=	zfsnap>0:filesystems/zfsnap

Packages

The version each package repository carries. “-” means the repository builds no package of it, “n/a” that there is no such repository.

Repositoryaarch64amd64armv6armv7i386
FreeBSD:14:latest1.11.1_11.11.1_1-1.11.1_11.11.1_1
FreeBSD:14:quarterly1.11.1_11.11.1_1n/a1.11.1_11.11.1_1
FreeBSD:15:latest1.11.1_11.11.1_1n/a1.11.1_11.11.1_1
FreeBSD:15:quarterly1.11.1_11.11.1_1n/an/an/a
FreeBSD:16:latest1.11.1_11.11.1_1n/an/an/a
FreeBSD:16:quarterlyn/an/an/an/an/a

Dependencies

The Makefile names none itself; they come from USES and USE_*.

The full lists below include those, and their dependencies in turn.

No port depends on this one.

Configuration

No options to configure.

Service scripts
none

Message after installing

To run zfSnap periodically you can add these options to your
	/etc/periodic.conf

	xPERIODICx_zfsnap_enable	- Enable xPERIODICx snapshots
					  (values: YES | NO)
	xPERIODICx_zfsnap_fs		- Space separated zfs filesystems
					  to create non-recursive snapshots
	xPERIODICx_zfsnap_recursive_fs	- Space separated zfs filesystems
					  to create recursive snapshots
	xPERIODICx_zfsnap_ttl		- Set Time To Live
	xPERIODICx_zfsnap_verbose	- Verbose output (values: YES | NO)
	xPERIODICx_zfsnap_flags		- zfSnap generic flags
					  (except -v and -d)
	xPERIODICx_zfsnap_enable_prefix - Create snapshots with prefix
					  (Default = YES)
	xPERIODICx_zfsnap_prefix	- Set prefix to use for new snapshots
					  (Default = "xPERIODICx-")
	(where xPERIODICx is any of hourly, daily, weekly, monthly, reboot)

	xPERIODICx_zfsnap_delete_enable    - Delete old snapshots periodically
					     (values: YES | NO)
	xPERIODICx_zfsnap_delete_flags	   - zfSnap generic flags
					     (except -v and -d)
	xPERIODICx_zfsnap_delete_verbose   - Verbose output (values: YES | NO)
	xPERIODICx_zfsnap_delete_prefixes  - Space separated list of prefixes
					     of old zfSnap snapshots to delete
					     'hourly-', 'daily-', 'weekly-',
					     'monthly-' and 'reboot-' prefixes
					     are hard-coded
	(where xPERIODICx is any of daily, weekly, monthly)


	Add these lines to your /etc/crontab
	4	*	*	*	*	root	periodic hourly
	@reboot					root	periodic reboot

	NOTE: it is not recommended to delete zfSnap snapshots every hour.
	Deleting zfs snapshots takes more time than creating them.
	There for it's better to delete snapshots once per day...


	Periodic scripts provide very limited feature set. If you want to use
	more advanced setup, you need to call zfSnap from crontab directly.
	This way you can combine all sort of parameter combinations.

	Don't forget to check https://github.com/graudeejs/zfSnap/wiki for more
	info.

	Feedback welcomed: [email protected]

Files

pkg-plist 10
  • sbin/zfSnap
  • %%PERIODICDIR%%/daily/402.zfSnap
  • %%PERIODICDIR%%/daily/403.zfSnap_delete
  • %%PERIODICDIR%%/hourly/402.zfSnap
  • %%PERIODICDIR%%/hourly/403.zfSnap_delete
  • %%PERIODICDIR%%/monthly/402.zfSnap
  • %%PERIODICDIR%%/monthly/403.zfSnap_delete
  • %%PERIODICDIR%%/reboot/402.zfSnap
  • %%PERIODICDIR%%/weekly/402.zfSnap
  • %%PERIODICDIR%%/weekly/403.zfSnap_delete
distinfo 1
FileSizeSHA256
zfsnap-zfsnap-v1.11.1_GH0.tar.gz4969dd533d5faff9fa98deeb9ae0909784b67b0dc43d3870f259eeb390fbc1d03bcf

Commit history 0

No commits in the history this site was built from.