Skip to content

Commit 7f6178e

Browse files
committed
Clean up README.md and comments
1 parent 5120bf3 commit 7f6178e

8 files changed

+38
-32
lines changed

README.md

100755100644
Lines changed: 33 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ the utility that creates the:
1414

1515
snapshots if it is installed.
1616

17-
## Installation using cron
18-
1917
This program is a posixly correct bourne shell script. It depends only on
20-
the zfs utilities and cron, and can run in the dash shell (using the scripts in
21-
`etc`).
18+
the zfs utilities and cron, and can run in the dash shell (using the scripts
19+
in `etc`).
2220

23-
```
21+
## Installation using cron
22+
23+
```sh
2424
wget https://github.com/zfsonlinux/zfs-auto-snapshot/archive/master.zip
2525
unzip master.zip
2626
cd zfs-auto-snapshot-master
@@ -29,52 +29,59 @@ make install
2929

3030
## Installation using systemd
3131

32-
I recommend scheduling this using [systemd timers](https://wiki.archlinux.org/index.php/Systemd/Timers).
32+
```sh
33+
wget https://github.com/zfsonlinux/zfs-auto-snapshot/archive/master.zip
34+
unzip master.zip
35+
cd zfs-auto-snapshot-master
36+
make systemd
37+
```
3338

34-
You can find some example `.timer` files in the `timers/` directory of this repo. They will be installed when you run `make install`.
39+
### Scheduling
3540

36-
You can enable the timers as follows:
41+
See [systemd timers](https://wiki.archlinux.org/index.php/Systemd/Timers).
3742

38-
```
39-
wget https://github.com/gaerfield/zfs-auto-snapshot/archive/master.zip
40-
unzip master.zip
41-
cd zfs-auto-snapshot-master
42-
make systemd
43-
```
43+
You can find some example `.timer` files in the `timers/` directory of this
44+
repo. They will be installed when you run `make systemd`.
4445

45-
If you wish to edit the timers, you will find them in the `/usr/local/lib/systemd/system/` directory. Save the edited timers to `/etc/systemd/system/` directory.
46+
If you wish to edit the timers, you will find them in the
47+
`/usr/local/lib/systemd/system/` directory. Save the edited timers to
48+
`/etc/systemd/system/` directory to override the default timers.
4649

47-
```
48-
cp /lib/systemd/system/zfs-auto-snapshot-frequent.timer /usr/systemd/system/
49-
cp /lib/systemd/system/zfs-auto-snapshot-frequent.service /usr/systemd/system/
50+
### Managing Which Pools to Snapshot
5051

51-
Managing Which Pools to Snapshot
52-
-------------
53-
By default, the script will snapshot all pools automatically, unless they have the `com.sun:auto-snapshot` property set to `false`.
52+
By default, the script will snapshot all pools automatically, unless they
53+
have the `com.sun:auto-snapshot` property set to `false`.
5454

55-
To check the status of this property for all of your pools and datasets, run the following command:
56-
```
55+
To check the status of this property for all of your pools and datasets, run
56+
the following command:
57+
58+
```sh
5759
sudo zfs get com.sun:auto-snapshot
5860
```
5961

60-
If you see an output like the following, then snapshots are enabled on this pool:
62+
If you see an output like the following, then snapshots are enabled on this
63+
pool:
64+
6165
```
6266
NAME PROPERTY VALUE SOURCE
6367
archive com.sun:auto-snapshot - -
6468
```
6569

6670
To disable snapshots on this pool, issue the following command:
67-
```
71+
72+
```sh
6873
sudo zfs set com.sun:auto-snapshot=false archive
6974
```
7075

7176
We can check with `zfs get` again, and this time our output should look like the following. If we see this, we know that snapshots have been disabled on this pool:
77+
7278
```
7379
NAME PROPERTY VALUE SOURCE
7480
archive com.sun:auto-snapshot false local
7581
```
7682

7783
To disable snapshots on a single dataset, the command is very similar:
78-
```
84+
85+
```sh
7986
sudo zfs set com.sun:auto-snapshot=false archive/dataset
8087
```

timers/zfs-auto-snapshot-daily.timer

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# See systemd.timers and systemd.time manpages for details
1+
# See systemd.timer and systemd.time manpages for details
22
[Unit]
33
Description=ZFS daily snapshot timer
44

timers/zfs-auto-snapshot-frequent.timer

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# See systemd.timers and systemd.time manpages for details
1+
# See systemd.timer and systemd.time manpages for details
22
[Unit]
33
Description=ZFS frequent snapshot timer
44

timers/zfs-auto-snapshot-hourly.timer

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# See systemd.timers and systemd.time manpages for details
1+
# See systemd.timer and systemd.time manpages for details
22
[Unit]
33
Description=ZFS hourly snapshot timer
44

timers/zfs-auto-snapshot-monthly.service

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
[Unit]
21
Description=ZFS monthly snapshot service
32

43
[Service]

timers/zfs-auto-snapshot-monthly.timer

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# See systemd.timers and systemd.time manpages for details
1+
# See systemd.timer and systemd.time manpages for details
22
[Unit]
33
Description=ZFS monthly snapshot timer
44

timers/zfs-auto-snapshot-weekly.timer

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# See systemd.timers and systemd.time manpages for details
21
[Unit]
32
Description=ZFS weekly snapshot timer
43

timers/zfs-auto-snapshot.target

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# See systemd.target and systemd.unit manpages for details
12
[Unit]
23
Description=Automatically create, rotate, and destroy periodic ZFS snapshots.
34
Requires=zfs-auto-snapshot-frequent.timer

0 commit comments

Comments
 (0)