aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md28
-rwxr-xr-xzb-cleanup1
-rwxr-xr-xzb-pull1
-rwxr-xr-xzb-snap1
4 files changed, 28 insertions, 3 deletions
diff --git a/README.md b/README.md
index a4184ea..03e4beb 100644
--- a/README.md
+++ b/README.md
@@ -12,13 +12,23 @@ The zfs backing-up tool. ha-ha.
recent snapshots of `remote_zfs_object` to `local_zfs_object`, using ssh
called with `ssh_connection`
-## Installation&requirements
+## Requirements
`bash` shell and `zfs` utils are needed. `zb-pull` requires `ssh`.
+zfs-backup requires GNU `date` or compatible, other `date` programs may fail.
+Test is simple, check if this command works for you:
+
+ date --date=now
+
+## Installation
+
Run `make install`, it installs itself to some `sbin/`. You can also specify
`DESTDIR=/usr/local/` or similar.
+For local changes (command aliases/wrappers, `PATH` setting etc.), file
+`$HOME/.zb-rc` is sourced before any commands are run.
+
## Example
$ zb-snap tank/test
@@ -78,7 +88,8 @@ And on remote backup machines:
- `zb-pull` every morning
- `zb-cleanup` with a slightly higher density number (it keeps more backups)
-### What exactly does zb-cleanup clean up?
+## FAQ
+#### What exactly does zb-cleanup clean up?
Candidates for backup deletion are determined like this:
@@ -89,7 +100,7 @@ Candidates for backup deletion are determined like this:
3. Calculate `density*(Y-X)/Y`. If the result is less than 1.0, delete the
_closer_ backup.
-### How to determine your density and other numbers?
+#### How to determine your density and other numbers?
Density is "maximum ratio of time between backups to age of backups, in
percent".
@@ -113,6 +124,17 @@ Good approach to determine it (with all the other numbers) is this:
value from the second row - in our case, daily. (probably in morning or
somehow off-peak hours).
+#### It doesn't work from cron!
+
+Check if the environment is the same as when you test the stuff from the command line. At least two common caveats exist:
+
+- `PATH` may be different in cron (which may select wrong `date` program to
+ run, or not find something other like custom-installed `zfs`). Edit
+ `~/.zb-rc` and fix `PATH` there.
+- Some SSH authentication methods may not work from cron environment due to
+ missing `ssh-agent`, especially the password-protected privkeys. Descriptions
+ of many workarounds are available around the internet.
+
## Disclaimer
Be sure to verify that this software really fits your use-case before you use
diff --git a/zb-cleanup b/zb-cleanup
index fd17e42..b4cb63b 100755
--- a/zb-cleanup
+++ b/zb-cleanup
@@ -1,6 +1,7 @@
#!/bin/bash
source /etc/profile >/dev/null
+[ -f "$HOME/.zb-rc" ] && source "$HOME/.zb-rc"
if [[ -z "$1" || -z "$2" ]] ; then
echo "usage: $0 <zfs_object> <density_percent> [max_age]" >&2
diff --git a/zb-pull b/zb-pull
index 2162061..1f07ca2 100755
--- a/zb-pull
+++ b/zb-pull
@@ -1,6 +1,7 @@
#!/bin/sh
source /etc/profile >/dev/null
+[ -f "$HOME/.zb-rc" ] && source "$HOME/.zb-rc"
if [[ -z "$1" || -z "$2" || -z "$3" ]] ; then
echo "usage: $0 <ssh_remote> <remote_zfs_object> <local_zfs_object>" >&2
diff --git a/zb-snap b/zb-snap
index c29b237..d32fb32 100755
--- a/zb-snap
+++ b/zb-snap
@@ -1,6 +1,7 @@
#!/bin/sh
source /etc/profile >/dev/null
+[ -f "$HOME/.zb-rc" ] && source "$HOME/.zb-rc"
if [ -z "$1" ] ; then
echo "usage: $0 <zfs_object>" >&2