psy0rz / zfs_autobackup

ZFS autobackup is used to periodicly backup ZFS filesystems to other locations. Easy to use and very reliable.
https://github.com/psy0rz/zfs_autobackup
GNU General Public License v3.0
583 stars 62 forks source link

Wiki Usage Missing #232

Closed natankeddem closed 10 months ago

natankeddem commented 11 months ago

This is the last commit with a Usage section in the Wiki. Was this intended? Was it moved somewhere else? https://github.com/psy0rz/zfs_autobackup/wiki/Home/b74015455221050f8caed250a449c778ff595574

psy0rz commented 11 months ago

Yes, the full manual now explains all the options.

natankeddem commented 11 months ago

I see that now. The old table was a great way to reference all arguments together very quickly. This way is more verbose and I appreciate that as well. Is it a possibility to have both?

psy0rz commented 11 months ago

Yeah, i can add that previous paragraph to the new page.

natankeddem commented 11 months ago

I appreciate it, thank you!

psy0rz commented 11 months ago

Dont close or i forget :p

natankeddem commented 11 months ago

Sorry, I didn't want to clutter your Issues.

natankeddem commented 11 months ago

Not sure if this is helpful but I got chatgpt to turn the -help output into a formatted table...

usage: ZfsAutobackup.py [--help] [--test] [--verbose] [--debug] [--debug-output] [--progress] [--utc] [--version] [--ssh-config CONFIG-FILE] [--ssh-source USER@HOST] [--ssh-target USER@HOST] [--property-format FORMAT] [--snapshot-format FORMAT] [--hold-format FORMAT] [--strip-path N] [--exclude-unchanged BYTES] [--exclude-received] [--no-snapshot] [--pre-snapshot-cmd COMMAND] [--post-snapshot-cmd COMMAND] [--min-change BYTES] [--allow-empty] [--other-snapshots] [--set-snapshot-properties PROPERTY=VALUE,...] [--no-send] [--no-holds] [--clear-refreservation] [--clear-mountpoint] [--filter-properties PROPERTY,...] [--set-properties PROPERTY=VALUE,...] [--rollback] [--force] [--destroy-incompatible] [--ignore-transfer-errors] [--decrypt] [--encrypt] [--zfs-compressed] [--compress [TYPE]] [--rate DATARATE] [--buffer SIZE] [--send-pipe COMMAND] [--recv-pipe COMMAND] [--no-thinning] [--keep-source SCHEDULE] [--keep-target SCHEDULE] [--destroy-missing SCHEDULE] [BACKUP-NAME] [TARGET-PATH]
Positional Arguments
BACKUP-NAME Name of the backup to select
TARGET-PATH Target ZFS filesystem (optional)
Common Options
--help, -h Show help
--test, --dry-run, -n Dry run, don't change anything, just show what would be done (still does all read-only operations)
--verbose, -v Verbose output
--debug, -d Show zfs commands that are executed, stops after an exception.
--debug-output Show zfs commands and their output/exit codes. (noisy)
--progress Show zfs progress output. Enabled automatically on ttys. (use --no-progress to disable)
--utc Use UTC instead of local time when dealing with timestamps for both formatting and parsing. To snapshot in an ISO 8601 compliant time format you may, for example, specify --snapshot-format "{}-%Y-%m-%dT%H:%M:%SZ". Changing this parameter after the fact (existing snapshots) will cause their timestamps to be interpreted as a different time than before.
--version Show version.
SSH Options
--ssh-config CONFIG-FILE Custom ssh client config
--ssh-source USER@HOST Source host to pull backup from.
--ssh-target USER@HOST Target host to push backup to.
String Formatting Options
--property-format FORMAT Dataset selection string format. Default: autobackup:{}
--snapshot-format FORMAT ZFS Snapshot string format. Default: {}-%Y%m%d%H%M%S
--hold-format FORMAT ZFS hold string format. Default: zfs_autobackup:{}
--strip-path N Number of directories to strip from the target path.
Selection Options
--exclude-unchanged BYTES Exclude datasets that have less than BYTES data changed since any last snapshot. (Use with proxmox HA replication)
--exclude-received Exclude datasets that have the origin of their autobackup: property as "received". This can avoid recursive replication between two backup partners.
Snapshot Options
--no-snapshot Don't create new snapshots (useful for finishing uncompleted backups, or cleanups)
--pre-snapshot-cmd COMMAND Run COMMAND before snapshotting (can be used multiple times.
--post-snapshot-cmd COMMAND Run COMMAND after snapshotting (can be used multiple times.
--min-change BYTES Only create snapshot if enough bytes are changed. (default 1)
--allow-empty If nothing has changed, still create empty snapshots. (Same as --min-change=0)
--other-snapshots Send over other snapshots as well, not just the ones created by this tool.
--set-snapshot-properties PROPERTY=VALUE,... List of properties to set on the snapshot.
Transfer Options
--no-send Don't transfer snapshots (useful for cleanups, or if you want a separate send-cronjob)
--no-holds Don't hold snapshots. (Faster. Allows you to destroy common snapshots.)
--clear-refreservation Filter "refreservation" property. (recommended, saves space. same as --filter-properties refreservation)
--clear-mountpoint Set property canmount=noauto for new datasets. (recommended, prevents mount conflicts. same as --set-properties canmount=noauto)
--filter-properties PROPERTY,... List of properties to "filter" when receiving filesystems. (you can still restore them with zfs inherit -S)
--set-properties PROPERTY=VALUE,... List of properties to override when receiving filesystems. (you can still restore them with zfs inherit -S)
--rollback Rollback changes to the latest target snapshot before starting. (normally you can prevent changes by setting the readonly property on the target_path to on)
--force, -F Use zfs -F option to force overwrite/rollback. (Useful with --strip-path=1, but use with care)
--destroy-incompatible Destroy incompatible snapshots on target. Use with care! (implies --rollback)
--ignore-transfer-errors Ignore transfer errors (still checks if received filesystem exists. useful for acltype errors)
--decrypt Decrypt data before sending it over.
--encrypt Encrypt data after receiving it.
--zfs-compressed Transfer blocks that already have zfs-compression as-is.
Data Transfer Options
--compress [TYPE] Use compression during transfer, defaults to zstd-fast if TYPE is not specified. (gzip, pigz-fast, pigz-slow, zstd-fast, zstd-slow, zstd-adapt, xz, lzo, lz4)
--rate DATARATE Limit data transfer rate in Bytes/sec (e.g. 128K. requires mbuffer.)
--buffer SIZE Add zfs send and recv buffers to smooth out IO bursts. (e.g. 128M. requires mbuffer)
--send-pipe COMMAND Pipe zfs send output through COMMAND (can be used multiple times)
--recv-pipe COMMAND Pipe zfs recv input through COMMAND (can be used multiple times)
Thinner Options
--no-thinning Do not destroy any snapshots.
--keep-source SCHEDULE Thinning schedule for old source snapshots. Default: 10,1d1w,1w1m,1m1y
--keep-target SCHEDULE Thinning schedule for old target snapshots. Default: 10,1d1w,1w1m,1m1y
--destroy-missing SCHEDULE Destroy datasets on target that are missing on the source. Specify the time since the last snapshot, e.g: --destroy-missing 30d
<table>
   <tr>
        <th colspan="2">usage: ZfsAutobackup.py [--help] [--test] [--verbose] [--debug] [--debug-output] [--progress] [--utc] [--version] [--ssh-config CONFIG-FILE]
                        [--ssh-source USER@HOST] [--ssh-target USER@HOST] [--property-format FORMAT] [--snapshot-format FORMAT] [--hold-format FORMAT]
                        [--strip-path N] [--exclude-unchanged BYTES] [--exclude-received] [--no-snapshot] [--pre-snapshot-cmd COMMAND]
                        [--post-snapshot-cmd COMMAND] [--min-change BYTES] [--allow-empty] [--other-snapshots]
                        [--set-snapshot-properties PROPERTY=VALUE,...] [--no-send] [--no-holds] [--clear-refreservation] [--clear-mountpoint]
                        [--filter-properties PROPERTY,...] [--set-properties PROPERTY=VALUE,...] [--rollback] [--force] [--destroy-incompatible]
                        [--ignore-transfer-errors] [--decrypt] [--encrypt] [--zfs-compressed] [--compress [TYPE]] [--rate DATARATE] [--buffer SIZE]
                        [--send-pipe COMMAND] [--recv-pipe COMMAND] [--no-thinning] [--keep-source SCHEDULE] [--keep-target SCHEDULE]
                        [--destroy-missing SCHEDULE]
                        [BACKUP-NAME] [TARGET-PATH]</th>
    </tr>
    <tr>
        <th colspan="2">Positional Arguments</th>
    </tr>
    <tr>
        <td>BACKUP-NAME</td>
        <td>Name of the backup to select</td>
    </tr>
    <tr>
        <td>TARGET-PATH</td>
        <td>Target ZFS filesystem (optional)</td>
    </tr>
    <tr>
        <th colspan="2">Common Options</th>
    </tr>
    <tr>
        <td>--help, -h</td>
        <td>Show help</td>
    </tr>
    <tr>
        <td>--test, --dry-run, -n</td>
        <td>Dry run, don't change anything, just show what would be done (still does all read-only operations)</td>
    </tr>
    <tr>
        <td>--verbose, -v</td>
        <td>Verbose output</td>
    </tr>
    <tr>
        <td>--debug, -d</td>
        <td>Show zfs commands that are executed, stops after an exception.</td>
    </tr>
    <tr>
        <td>--debug-output</td>
        <td>Show zfs commands and their output/exit codes. (noisy)</td>
    </tr>
    <tr>
        <td>--progress</td>
        <td>Show zfs progress output. Enabled automatically on ttys. (use --no-progress to disable)</td>
    </tr>
    <tr>
        <td>--utc</td>
        <td>Use UTC instead of local time when dealing with timestamps for both formatting and parsing. To snapshot in an ISO 8601 compliant time format you may, for example, specify --snapshot-format "{}-%Y-%m-%dT%H:%M:%SZ". Changing this parameter after the fact (existing snapshots) will cause their timestamps to be interpreted as a different time than before.</td>
    </tr>
    <tr>
        <td>--version</td>
        <td>Show version.</td>
    </tr>
    <tr>
        <th colspan="2">SSH Options</th>
    </tr>
    <tr>
        <td>--ssh-config CONFIG-FILE</td>
        <td>Custom ssh client config</td>
    </tr>
    <tr>
        <td>--ssh-source USER@HOST</td>
        <td>Source host to pull backup from.</td>
    </tr>
    <tr>
        <td>--ssh-target USER@HOST</td>
        <td>Target host to push backup to.</td>
    </tr>
    <tr>
        <th colspan="2">String Formatting Options</th>
    </tr>
    <tr>
        <td>--property-format FORMAT</td>
        <td>Dataset selection string format. Default: autobackup:{} </td>
    </tr>
    <tr>
        <td>--snapshot-format FORMAT</td>
        <td>ZFS Snapshot string format. Default: {}-%Y%m%d%H%M%S</td>
    </tr>
    <tr>
        <td>--hold-format FORMAT</td>
        <td>ZFS hold string format. Default: zfs_autobackup:{}</td>
    </tr>
    <tr>
        <td>--strip-path N</td>
        <td>Number of directories to strip from the target path.</td>
    </tr>
    <tr>
        <th colspan="2">Selection Options</th>
    </tr>
    <tr>
        <td>--exclude-unchanged BYTES</td>
        <td>Exclude datasets that have less than BYTES data changed since any last snapshot. (Use with proxmox HA replication)</td>
    </tr>
    <tr>
        <td>--exclude-received</td>
        <td>Exclude datasets that have the origin of their autobackup: property as "received". This can avoid recursive replication between two backup partners.</td>
    </tr>
    <tr>
        <th colspan="2">Snapshot Options</th>
    </tr>
    <tr>
        <td>--no-snapshot</td>
        <td>Don't create new snapshots (useful for finishing uncompleted backups, or cleanups)</td>
    </tr>
    <tr>
        <td>--pre-snapshot-cmd COMMAND</td>
        <td>Run COMMAND before snapshotting (can be used multiple times.</td>
    </tr>
    <tr>
        <td>--post-snapshot-cmd COMMAND</td>
        <td>Run COMMAND after snapshotting (can be used multiple times.</td>
    </tr>
    <tr>
        <td>--min-change BYTES</td>
        <td>Only create snapshot if enough bytes are changed. (default 1)</td>
    </tr>
    <tr>
        <td>--allow-empty</td>
        <td>If nothing has changed, still create empty snapshots. (Same as --min-change=0)</td>
    </tr>
    <tr>
        <td>--other-snapshots</td>
        <td>Send over other snapshots as well, not just the ones created by this tool.</td>
    </tr>
    <tr>
        <td>--set-snapshot-properties PROPERTY=VALUE,...</td>
        <td>List of properties to set on the snapshot.</td>
    </tr>
    <tr>
        <th colspan="2">Transfer Options</th>
    </tr>
    <tr>
        <td>--no-send</td>
        <td>Don't transfer snapshots (useful for cleanups, or if you want a separate send-cronjob)</td>
    </tr>
    <tr>
        <td>--no-holds</td>
        <td>Don't hold snapshots. (Faster. Allows you to destroy common snapshots.)</td>
    </tr>
    <tr>
        <td>--clear-refreservation</td>
        <td>Filter "refreservation" property. (recommended, saves space. same as --filter-properties refreservation)</td>
    </tr>
    <tr>
        <td>--clear-mountpoint</td>
        <td>Set property canmount=noauto for new datasets. (recommended, prevents mount conflicts. same as --set-properties canmount=noauto)</td>
    </tr>
    <tr>
        <td>--filter-properties PROPERTY,...</td>
        <td>List of properties to "filter" when receiving filesystems. (you can still restore them with zfs inherit -S)</td>
    </tr>
    <tr>
        <td>--set-properties PROPERTY=VALUE,...</td>
        <td>List of properties to override when receiving filesystems. (you can still restore them with zfs inherit -S)</td>
    </tr>
    <tr>
        <td>--rollback</td>
        <td>Rollback changes to the latest target snapshot before starting. (normally you can prevent changes by setting the readonly property on the target_path to on)</td>
    </tr>
    <tr>
        <td>--force, -F</td>
        <td>Use zfs -F option to force overwrite/rollback. (Useful with --strip-path=1, but use with care)</td>
    </tr>
    <tr>
        <td>--destroy-incompatible</td>
        <td>Destroy incompatible snapshots on target. Use with care! (implies --rollback)</td>
    </tr>
    <tr>
        <td>--ignore-transfer-errors</td>
        <td>Ignore transfer errors (still checks if received filesystem exists. useful for acltype errors)</td>
    </tr>
    <tr>
        <td>--decrypt</td>
        <td>Decrypt data before sending it over.</td>
    </tr>
    <tr>
        <td>--encrypt</td>
        <td>Encrypt data after receiving it.</td>
    </tr>
    <tr>
        <td>--zfs-compressed</td>
        <td>Transfer blocks that already have zfs-compression as-is.</td>
    </tr>
    <tr>
        <th colspan="2">Data Transfer Options</th>
    </tr>
    <tr>
        <td>--compress [TYPE]</td>
        <td>Use compression during transfer, defaults to zstd-fast if TYPE is not specified. (gzip, pigz-fast, pigz-slow, zstd-fast, zstd-slow, zstd-adapt, xz, lzo, lz4)</td>
    </tr>
    <tr>
        <td>--rate DATARATE</td>
        <td>Limit data transfer rate in Bytes/sec (e.g. 128K. requires mbuffer.)</td>
    </tr>
    <tr>
        <td>--buffer SIZE</td>
        <td>Add zfs send and recv buffers to smooth out IO bursts. (e.g. 128M. requires mbuffer)</td>
    </tr>
    <tr>
        <td>--send-pipe COMMAND</td>
        <td>Pipe zfs send output through COMMAND (can be used multiple times)</td>
    </tr>
    <tr>
        <td>--recv-pipe COMMAND</td>
        <td>Pipe zfs recv input through COMMAND (can be used multiple times)</td>
    </tr>
    <tr>
        <th colspan="2">Thinner Options</th>
    </tr>
    <tr>
        <td>--no-thinning</td>
        <td>Do not destroy any snapshots.</td>
    </tr>
    <tr>
        <td>--keep-source SCHEDULE</td>
        <td>Thinning schedule for old source snapshots. Default: 10,1d1w,1w1m,1m1y</td>
    </tr>
    <tr>
        <td>--keep-target SCHEDULE</td>
        <td>Thinning schedule for old target snapshots. Default: 10,1d1w,1w1m,1m1y</td>
    </tr>
    <tr>
        <td>--destroy-missing SCHEDULE</td>
        <td>Destroy datasets on target that are missing on the source. Specify the time since the last snapshot, e.g: --destroy-missing 30d</td>
    </tr>
</table>
psy0rz commented 10 months ago

fixed: https://github.com/psy0rz/zfs_autobackup/wiki/Manual

natankeddem commented 10 months ago

I guess you didn't like the table. 😆

psy0rz commented 10 months ago

Nope sorry :p

natankeddem commented 10 months ago

No problem, thank you again for the quick response.