Skip to content
Open

Zevo #11

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions Library/org.zfs.snapshot.hourly.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.zfs.snapshot.hourly</string>
<key>ProgramArguments</key>
<array>
<string>/usr/sbin/zfs-auto-snapshot.sh</string>
<string>--syslog</string>
<string>--keep=24</string>
<string>--label=hourly</string>
<string>//</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>StartInterval</key>
<integer>3600</integer>
</dict>
</plist>
27 changes: 14 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
SUPPORTED_PLATFORMS=linux-gnu darwin12 darwin11

ifeq (,$(findstring $(OSTYPE),$(SUPPORTED_PLATFORMS)))

all %:
@echo The OS environment variable is set to [$(OSTYPE)].
@echo Please set the OS environment variable to one of the following:
@echo $(SUPPORTED_PLATFORMS)

else

all:

install:
install -d $(DESTDIR)$(PREFIX)/etc/cron.d
install -d $(DESTDIR)$(PREFIX)/etc/cron.daily
install -d $(DESTDIR)$(PREFIX)/etc/cron.hourly
install -d $(DESTDIR)$(PREFIX)/etc/cron.weekly
install -d $(DESTDIR)$(PREFIX)/etc/cron.monthly
install etc/zfs-auto-snapshot.cron.frequent $(DESTDIR)$(PREFIX)/etc/cron.d/zfs-auto-snapshot
install etc/zfs-auto-snapshot.cron.hourly $(DESTDIR)$(PREFIX)/etc/cron.hourly/zfs-auto-snapshot
install etc/zfs-auto-snapshot.cron.daily $(DESTDIR)$(PREFIX)/etc/cron.daily/zfs-auto-snapshot
install etc/zfs-auto-snapshot.cron.weekly $(DESTDIR)$(PREFIX)/etc/cron.weekly/zfs-auto-snapshot
install etc/zfs-auto-snapshot.cron.monthly $(DESTDIR)$(PREFIX)/etc/cron.monthly/zfs-auto-snapshot
install -d $(DESTDIR)$(PREFIX)/sbin
install src/zfs-auto-snapshot.sh $(DESTDIR)$(PREFIX)/sbin/zfs-auto-snapshot
include makefile.$(OSTYPE)

endif
26 changes: 21 additions & 5 deletions README
Original file line number Diff line number Diff line change
@@ -1,12 +1,28 @@
zfs-auto-snapshot:

An alternative implementation of the zfs-auto-snapshot service for Linux
that is compatible with zfs-linux and zfs-fuse.
and Macosx (currently tested and compatible with ZEVO Community Edition).

Automatically create, rotate, and destroy periodic ZFS snapshots. This is
the utility that creates the @zfs-auto-snap_frequent, @zfs-auto-snap_hourly,
It can automatically create, rotate, and destroy periodic ZFS snapshots. This
is utility that creates the @zfs-auto-snap_frequent, @zfs-auto-snap_hourly,
@zfs-auto-snap_daily, @zfs-auto-snap_weekly, and @zfs-auto-snap_monthly
snapshots if it is installed.

This program is a posixly correct bourne shell script. It depends only on
the zfs utilities and cron, and can run in the dash shell.
It can backup (send) the snapshots to remote systems or external disks,
utilizing zfs send command. On darwin this can replace TimeMachine backups,
currently not running on top of ZFS filesystems.

This program is a posixly correct bourne shell script. It depends on zfs
utilities only (Linux). Unfortunatelly on Darwin it needs 'getopt' from
macports or homebrew.

For using --send option, adapt opt_sendtocmd variable accordingly by editing the
script zfs-auto-snapshot.sh.

sudo make OSTYPE=linux|darwin install

installs cron / launchd startup scripts and copies script to /usr/sbin
directory.

On darwin for daily, weekly and monthly stuff, anacron install is highly
recommended.
7 changes: 7 additions & 0 deletions makefile.darwin11
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

install:

install Library/org.zfs.snapshot.hourly.plist /Library/LaunchDaemons/org.zfs.snapshot.hourly.plist
install src/zfs-auto-snapshot.sh /usr/sbin/zfs-auto-snapshot.sh
launchctl load -w /Library/LaunchDaemons/org.zfs.snapshot.hourly.plist

7 changes: 7 additions & 0 deletions makefile.darwin12
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

install:

install Library/org.zfs.snapshot.hourly.plist /Library/LaunchDaemons/org.zfs.snapshot.hourly.plist
install src/zfs-auto-snapshot.sh /usr/sbin/zfs-auto-snapshot.sh
launchctl load -w /Library/LaunchDaemons/org.zfs.snapshot.hourly.plist

15 changes: 15 additions & 0 deletions makefile.linux-gnu
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

install:

install -d $(DESTDIR)$(PREFIX)/etc/cron.d
install -d $(DESTDIR)$(PREFIX)/etc/cron.daily
install -d $(DESTDIR)$(PREFIX)/etc/cron.hourly
install -d $(DESTDIR)$(PREFIX)/etc/cron.weekly
install -d $(DESTDIR)$(PREFIX)/etc/cron.monthly
install etc/zfs-auto-snapshot.cron.frequent $(DESTDIR)$(PREFIX)/etc/cron.d/zfs-auto-snapshot
install etc/zfs-auto-snapshot.cron.hourly $(DESTDIR)$(PREFIX)/etc/cron.hourly/zfs-auto-snapshot
install etc/zfs-auto-snapshot.cron.daily $(DESTDIR)$(PREFIX)/etc/cron.daily/zfs-auto-snapshot
install etc/zfs-auto-snapshot.cron.weekly $(DESTDIR)$(PREFIX)/etc/cron.weekly/zfs-auto-snapshot
install etc/zfs-auto-snapshot.cron.monthly $(DESTDIR)$(PREFIX)/etc/cron.monthly/zfs-auto-snapshot
install -d $(DESTDIR)$(PREFIX)/sbin
install src/zfs-auto-snapshot.sh $(DESTDIR)$(PREFIX)/sbin/zfs-auto-snapshot
Loading