update the install instruction with recent changes

This commit is contained in:
Christoph Klaffl 2019-02-20 08:15:45 +01:00
parent 0f669a304a
commit eefc659c03
No known key found for this signature in database
GPG Key ID: FC1C525C2A47CC28
1 changed files with 47 additions and 8 deletions

View File

@ -5,7 +5,7 @@
<!-- TOC depthFrom:1 depthTo:6 withLinks:1 updateOnSave:0 orderedList:0 -->
- [Installation](#installation)
- [Ubuntu](#ubuntu)
- [Debian/Ubuntu](#debianubuntu)
- [CentOS](#centos)
- [FreeBSD](#freebsd)
- [Other OSes](#other-oses)
@ -15,7 +15,7 @@
<!-- /TOC -->
## Ubuntu
## Debian/Ubuntu
Install prerequisite software:
@ -23,6 +23,24 @@ Install prerequisite software:
apt install libconfig-inifiles-perl pv lzop mbuffer
```
Clone this repo, build the debian package and install it (alternatively you can skip the package and do it manually like described below for CentOS):
```bash
# Download the repo as root to avoid changing permissions later
sudo git clone https://github.com/jimsalterjrs/sanoid.git
cd sanoid
ln -s packages/debian .
dpkg-buildpackage -uc -us
apt install ../sanoid_*_all.deb
```
Enable sanoid timer:
```bash
# enable and start the sanoid timer
sudo systemctl enable sanoid.timer
sudo systemctl start sanoid.timer
```
## CentOS
Install prerequisite software:
@ -60,23 +78,42 @@ cat << "EOF" | sudo tee /etc/systemd/system/sanoid.service
Description=Snapshot ZFS Pool
Requires=zfs.target
After=zfs.target
ConditionFileNotEmpty=/etc/sanoid/sanoid.conf
[Service]
Environment=TZ=UTC
Type=oneshot
ExecStart=/usr/sbin/sanoid --cron
ExecStart=/usr/sbin/sanoid --take-snapshots
EOF
cat << "EOF" | sudo tee /etc/systemd/system/sanoid-prune.service
[Unit]
Description=Cleanup ZFS Pool
Requires=zfs.target
After=zfs.target sanoid.service
ConditionFileNotEmpty=/etc/sanoid/sanoid.conf
[Service]
Environment=TZ=UTC
Type=oneshot
ExecStart=/usr/sbin/sanoid --prune-snapshots
[Install]
WantedBy=sanoid.service
EOF
```
And a systemd timer that will execute **Sanoid** once per minute:
And a systemd timer that will execute **Sanoid** once per quarter hour
(Decrease the interval as suitable for configuration):
```bash
cat << "EOF" | sudo tee /etc/systemd/system/sanoid.timer
[Unit]
Description=Run Sanoid Every Minute
Description=Run Sanoid Every 15 Minutes
Requires=sanoid.service
[Timer]
OnCalendar=*:0/1
OnCalendar=*:0/15
Persistent=true
[Install]
@ -100,7 +137,7 @@ Now, proceed to configure [**Sanoid**](#configuration)
Install prerequisite software:
```bash
pkg install p5-Config-Inifiles pv lzop
pkg install p5-Config-Inifiles pv mbuffer lzop
```
**Additional notes:**
@ -109,6 +146,8 @@ pkg install p5-Config-Inifiles pv lzop
* Simplest path workaround is symlinks, eg `ln -s /usr/local/bin/lzop /usr/bin/lzop` or similar, as appropriate to create links in **/usr/bin** to wherever the utilities actually are on your system.
* See note about mbuffer and other things in FREEBSD.readme
## 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.
@ -130,4 +169,4 @@ pkg install p5-Config-Inifiles pv lzop
## Sanoid
Instructions on how to set up `sanoid.conf`. Maybe just copy/paste the example `sanoid.conf` file in here but clean it up a little bit.
Take a look at the files `sanoid.defaults.conf` and` sanoid.conf.example` for all possible configuration options. Also have a look at the README.md