mirror of
https://github.com/psy0rz/zfs_autobackup.git
synced 2025-06-05 01:33:00 +03:00
Update README.md
This commit is contained in:
parent
a7bf1e8af8
commit
bf37322aba
26
README.md
26
README.md
@ -29,14 +29,15 @@ Usage
|
|||||||
====
|
====
|
||||||
```
|
```
|
||||||
usage: zfs_autobackup [-h] [--ssh-source SSH_SOURCE] [--ssh-target SSH_TARGET]
|
usage: zfs_autobackup [-h] [--ssh-source SSH_SOURCE] [--ssh-target SSH_TARGET]
|
||||||
[--ssh-cipher SSH_CIPHER] [--keep-source KEEP_SOURCE]
|
[--keep-source KEEP_SOURCE] [--keep-target KEEP_TARGET]
|
||||||
[--keep-target KEEP_TARGET] [--no-snapshot] [--no-send]
|
[--no-snapshot] [--no-send] [--resume]
|
||||||
[--resume] [--strip-path STRIP_PATH] [--destroy-stale]
|
[--strip-path STRIP_PATH] [--destroy-stale]
|
||||||
[--clear-refreservation] [--clear-mountpoint]
|
[--clear-refreservation] [--clear-mountpoint]
|
||||||
[--rollback] [--compress] [--test] [--verbose] [--debug]
|
[--filter-properties FILTER_PROPERTIES] [--rollback]
|
||||||
|
[--test] [--verbose] [--debug]
|
||||||
backup_name target_fs
|
backup_name target_fs
|
||||||
|
|
||||||
ZFS autobackup v2.1
|
ZFS autobackup v2.2
|
||||||
|
|
||||||
positional arguments:
|
positional arguments:
|
||||||
backup_name Name of the backup (you should set the zfs property
|
backup_name Name of the backup (you should set the zfs property
|
||||||
@ -52,8 +53,6 @@ optional arguments:
|
|||||||
--ssh-target SSH_TARGET
|
--ssh-target SSH_TARGET
|
||||||
Target host to push backup to. (user@hostname) Default
|
Target host to push backup to. (user@hostname) Default
|
||||||
local.
|
local.
|
||||||
--ssh-cipher SSH_CIPHER
|
|
||||||
SSH cipher to use (default None)
|
|
||||||
--keep-source KEEP_SOURCE
|
--keep-source KEEP_SOURCE
|
||||||
Number of days to keep old snapshots on source.
|
Number of days to keep old snapshots on source.
|
||||||
Default 30.
|
Default 30.
|
||||||
@ -65,7 +64,10 @@ optional arguments:
|
|||||||
--no-send dont send snapshots (usefull to only do a cleanup)
|
--no-send dont send snapshots (usefull to only do a cleanup)
|
||||||
--resume support resuming of interrupted transfers by using the
|
--resume support resuming of interrupted transfers by using the
|
||||||
zfs extensible_dataset feature (both zpools should
|
zfs extensible_dataset feature (both zpools should
|
||||||
have it enabled)
|
have it enabled) Disadvantage is that you need to use
|
||||||
|
zfs recv -A if another snapshot is created on the
|
||||||
|
target during a receive. Otherwise it will keep
|
||||||
|
failing.
|
||||||
--strip-path STRIP_PATH
|
--strip-path STRIP_PATH
|
||||||
number of directory to strip from path (use 1 when
|
number of directory to strip from path (use 1 when
|
||||||
cloning zones between 2 SmartOS machines)
|
cloning zones between 2 SmartOS machines)
|
||||||
@ -85,7 +87,6 @@ optional arguments:
|
|||||||
--rollback Rollback changes on the target before starting a
|
--rollback Rollback changes on the target before starting a
|
||||||
backup. (normally you can prevent changes by setting
|
backup. (normally you can prevent changes by setting
|
||||||
the readonly property on the target_fs to on)
|
the readonly property on the target_fs to on)
|
||||||
--compress use compression during zfs send/recv
|
|
||||||
--test dont change anything, just show what would be done
|
--test dont change anything, just show what would be done
|
||||||
(still does all read-only operations)
|
(still does all read-only operations)
|
||||||
--verbose verbose output
|
--verbose verbose output
|
||||||
@ -136,7 +137,7 @@ First install the ssh-key on the server that you specify with --ssh-source or --
|
|||||||
|
|
||||||
Method 1: Run the script on the backup server and pull the data from the server specfied by --ssh-source. This is usually the preferred way and prevents a hacked server from accesing the backup-data:
|
Method 1: Run the script on the backup server and pull the data from the server specfied by --ssh-source. This is usually the preferred way and prevents a hacked server from accesing the backup-data:
|
||||||
```
|
```
|
||||||
root@fs1:/home/psy# ./zfs_autobackup --ssh-source root@1.2.3.4 smartos01_fs1 fs1/zones/backup/zfsbackups/smartos01.server.com --verbose --compress
|
root@fs1:/home/psy# ./zfs_autobackup --ssh-source root@1.2.3.4 smartos01_fs1 fs1/zones/backup/zfsbackups/smartos01.server.com --verbose
|
||||||
Getting selected source filesystems for backup smartos01_fs1 on root@1.2.3.4
|
Getting selected source filesystems for backup smartos01_fs1 on root@1.2.3.4
|
||||||
Selected: zones (direct selection)
|
Selected: zones (direct selection)
|
||||||
Selected: zones/1eb33958-72c1-11e4-af42-ff0790f603dd (inherited selection)
|
Selected: zones/1eb33958-72c1-11e4-af42-ff0790f603dd (inherited selection)
|
||||||
@ -182,7 +183,7 @@ Host *
|
|||||||
ControlPersist 3600
|
ControlPersist 3600
|
||||||
```
|
```
|
||||||
|
|
||||||
This will make all your ssh connection persistent and greatly speed up zfs_autobackup for jobs with short intervals.
|
This will make all your ssh connections persistent and greatly speed up zfs_autobackup for jobs with short intervals.
|
||||||
|
|
||||||
Thanks @mariusvw :)
|
Thanks @mariusvw :)
|
||||||
|
|
||||||
@ -196,10 +197,13 @@ Host smartos04
|
|||||||
Hostname 1.2.3.4
|
Hostname 1.2.3.4
|
||||||
Port 1234
|
Port 1234
|
||||||
user root
|
user root
|
||||||
|
Compression yes
|
||||||
```
|
```
|
||||||
|
|
||||||
This way you can just specify smartos04
|
This way you can just specify smartos04
|
||||||
|
|
||||||
|
Also uses compression on slow links.
|
||||||
|
|
||||||
Look in man ssh_config for many more options.
|
Look in man ssh_config for many more options.
|
||||||
|
|
||||||
Troubleshooting
|
Troubleshooting
|
||||||
|
Loading…
x
Reference in New Issue
Block a user