From c125835e4433c6d5e852b1e06b0fa710dcb695f9 Mon Sep 17 00:00:00 2001 From: Gerhard Roethlin Date: Fri, 23 Jul 2021 17:39:28 +0200 Subject: [PATCH] MacOS Install Information Installation information for running sanoid on MacOS via launchd. A launchd example plist file is provided in the same way equivalent files are created on other platforms. --- INSTALL.md | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/INSTALL.md b/INSTALL.md index c8411d3..5e4a6e3 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -171,6 +171,51 @@ For Alpine Linux this can be done with: `apk --no-cache add procps` +## MacOS + +Install prerequisite software: + +``` +perl -MCPAN -e install Config::IniFiles +``` + +The crontab can be used as on a normal unix. To use launchd instead, this example config file can be use can be used. Modify it for your needs. In particular, adjust the sanoid path. +It will start sanoid once per hour, at minute 51. Missed invocations due to standby will be merged into a single invocation at the next wakeup. + +```bash +cat << "EOF" | sudo tee /Library/LaunchDaemons/net.openoid.Sanoid.plist + + + + + Label + net.openoid.Sanoid + ProgramArguments + + /usr/local/sanoid/sanoid + --cron + + EnvironmentVariables + + TZ + UTC + PATH + /usr/local/zfs/bin:$PATH:/usr/local/bin + + StartCalendarInterval + + + Minute + 51 + + + + +EOF + +sudo launchctl load /Library/LaunchDaemons/net.openoid.Sanoid.plist +``` + ## Other OSes **Sanoid** depends on the Perl module Config::IniFiles and will not operate without it. Config::IniFiles may be installed from CPAN, though the project strongly recommends using your distribution's repositories instead.