create
8BitSafe-cli [common options] archive create [options] [REPO::ARCHIVE] [PATH...]
| positional arguments | description |
|---|---|
| REPO::ARCHIVE | name of archive to create (must be also a valid directory name) |
| PATH(S) | paths to archive |
| optional arguments | description | default | allowed |
|---|---|---|---|
| -e,--exclude <patterns> | exclude pattern(s) | paths or glob patterns | |
| --chunker-params <params> | MIN_EXP, MAX_EXP, HASH_MASK_BITS, HASH_WINDOW_SIZE | 19,22,21,4095 | |
| -c,--compression <algo,lvl> | Compression algo | lz4 | supported values |
| --no-compression-patterns | Disable default compression patterns | - | |
| --compression-patterns <path> | Path to compression patterns file | - | compression-patterns path |
| --comment <text> | A comment to include in archive | - | string |
| --num-thread <num> | Number of worker threads | -1 | integer |
| --ratelimit <limitString> | Upload rate limit | - | limitString |
| --manifest <path> | Write a manifest to the provide path (optional compression) | - | |
| --abort-on-missing | Abort the backup if an archive path is missing | - | |
| --abort-on-sharing-violation | Abort the backup if we fail to open a file due to sharing violation | - | |
| --abort-on-lock-violation | Abort the backup if we fail to open a file due to lock violation | - | |
| --no-cache | Do not use/update any caches | - | |
| --no-file-cache | Do not use/update file cache | - | |
| --no-obj-cache | Do not use/update object cache | - | |
| --file-cache-no-expire | Items added to the file cache never expire | - | |
| --file-cache-ttl | How long items in the file cache are valid | 10months | durationString |
| --file-cache-jitter | Defines the upper bound of random jitter added to ttl | 12months | durationString |
Description
This command creates a backup archive containing all files found while recursively traversing all paths specified. Paths are added to the archive as they are given, that means if relative paths are desired, the command has to be run from the correct directory.
Passing individual files as paths is also supported
Archive name
Every archive name in a single repository must be unique and a valid directory name.
To help with creating a unique name for each archive we support a number of placeholders for example docs-{user}-{nowutc}.
See placeholders for more details.
The name must not end with a space or contain the following prohibited characters: <,>,:,",/,\,|,?,*.
Compression
With the -c,--compression <algo,lvl> option you can set the default compression algorithm, that will be used for files without matching compression patterns.
See here for details about supported compression algorithms and levels.
Examples
- Windows
- Unix
8BitSafe-cli.exe archive create -c lz4,4 D:\backup\repo::docs-{nowutc} C:\User\Tom\Docs
8BitSafe-cli.exe archive create -c zstd D:\backup\repo::docs-{nowutc} C:\User\Tom\Docs
8BitSafe-cli.exe archive create -c zstd,18 D:\backup\repo::docs-{nowutc} C:\User\Tom\Docs
8BitSafe-cli.exe archive create -c zstd,fast D:\backup\repo::docs-{nowutc} C:\User\Tom\Docs
8BitSafe-cli archive create -c lz4,4 /mnt/tank/backup::docs-{nowutc} /home/jane/docs
8BitSafe-cli archive create -c zstd /mnt/tank/backup::docs-{nowutc} /home/jane/docs
8BitSafe-cli archive create -c zstd,18 /mnt/tank/backup::docs-{nowutc} /home/jane/docs
8BitSafe-cli archive create -c zstd,fast /mnt/tank/backup::docs-{nowutc} /home/jane/docs
Compression patterns file
You can optionally pass a path to a file containing compression patterns. This allows you to disable or change the compression settings for various files using glob patterns.
When you don't pass a custom compression patterns file a default set of patterns is used see compression patterns for details.
You can use --no-compression-patterns to disable the default compression patterns.
Data rate
You can limit the speed at which data is pushed to the repo this works for all store types, even local disk.
This argument takes a human data rate.
Examples
- Windows
- Unix
8BitSafe-clicli.exe --ratelimit 15Mbps archive create D:\backup\repo::docs-{nowutc} C:\User\Tom\Docs
8BitSafe-cli --ratelimit 15Mbps archive create /mnt/tank/backup::docs-{nowutc} /home/tom/docs
Manifest
For each archive created you can write a manifest file which contains a full list of archived in json format.
These manifest files can be useful for automation or manually inspecting the contents of an archive.
The --manifest option takes a path that can be a directory and the file name is automatically generated including the current timestamp, or it can be a full path which supports the same placeholders as archive name (see above).
Examples
- Windows
- Unix
Directory only (file name is auto generated):
8BitSafe-cli.exe archive create --manifest D:\backups\repo\manifests\ D:\storage\backups\repo::{user}-{nowutc} C:\misc
Full path (file is overwritten each time):
8BitSafe-cli.exe archive create --manifest D:\backups\repo\manifests\fixed_name.json D:\storage\backups\repo::{user}-{nowutc} C:\misc
Full path using placeholders:
8BitSafe-cli.exe archive create --manifest D:\backups\repo\manifests\manifest_{user}-{nowutc}.json D:\storage\backups\repo::{user}-{nowutc} C:\misc
Directory only (file name is auto generated):
8BitSafe-cli archive create --manifest /mnt/backups/manifests/ /mnt/backups/repo::{user}-{nowutc} /home/
Full path (file is overwritten each time):
8BitSafe-cli archive create --manifest /mnt/backups/manifests/fixed_name.json /mnt/backups/repo::{user}-{nowutc} /home/
Full path using placeholders:
8BitSafe-cli archive create --manifest /mnt/backups/manifests/manifest_{user}-{nowutc}.json /mnt/backups/repo::{user}-{nowutc} /home/
Example manifest output
[
{
"name": "<root>",
"flags": 0,
"filesys_id": 0,
"time_create": 0,
"time_access": 0,
"time_write": 0,
"group_id": 0,
"user_id": 0,
"size": 19335910709,
"size_deflated": 12934687672,
"hash": "886a0410b64e24d8318a695b7f59d37b7401e4b281d628365485502d349c53af",
"num_children": 44689,
"children": [
{
"name": "D:\\Documents",
"flags": 8,
"filesys_id": 0,
"time_create": 132532914246050287,
"time_access": 0,
"time_write": 132813120749659067,
"group_id": 0,
"user_id": 0,
"size": 8905372573,
"size_deflated": 8812494813,
"hash": "b3bb02f6ab5ef5a6f680c2abd74a0743b5d12ef3aa79d1bd147e1f16b9039949",
"num_children": 1561,
"children": [
...
Manifest Compression
Since the manifest file are text based they compress well.
Compression is enabled via the file extension.
Currently supported file extensions are:
| extension | algo | mode | compression level |
|---|---|---|---|
| zip | zip | Deflate | Default |
Manifest Compression examples
- Windows
- Unix
8BitSafe-cli.exe archive create -c zstd --manifest D:\backups\repo\manifests\{user}-{nowutc}.json.zip D:\storage\backups\repo::{user}-{nowutc} C:\misc
8BitSafe-cli archive create -c zstd --manifest /mnt/backups/manifests/{user}-{nowutc}.json.zip /mnt/backups/repo::{user}-{nowutc} C:\misc
Various Examples
- Windows
- Unix
8BitSafe-cli.exe archive create D:\backups\repo::{user}-images-{nowutc} "C:\Users\Bob\My Images"
8BitSafe-cli.exe archive create -c lz4 D:\backups\repo::{user}-{nowutc} C:\important_docs
8BitSafe-cli.exe archive create -c lz4,fast D:\backups\repo::{user}-{nowutc} C:\important_docs -e "*.DS_Store"
8BitSafe-cli.exe archive create -c lz4 D:\backups\repo::{user}-{nowutc} C:\important_docs -e "*.DS_Store"
8BitSafe-cli.exe archive create --manifest D:\manifests\{nowutc}.json.zip D:\storage\backups\repo::{user}-{nowutc} C:\misc
8BitSafe-cli.exe archive create -c zstd,fast --abort-on-missing D:\backups\repo::{user}-{nowutc} C:\company_docs
8BitSafe-cli archive create D:\backups\repo::{user}-images-{nowutc} "C:\Users\Bob\My Images"
8BitSafe-cli archive create -c lz4 D:\backups\repo::{user}-{nowutc} C:\important_docs
8BitSafe-cli archive create -c lz4,fast D:\backups\repo::{user}-{nowutc} C:\important_docs -e "*.DS_Store"
8BitSafe-cli archive create -c lz4 D:\backups\repo::{user}-{nowutc} C:\important_docs -e "*.DS_Store"
8BitSafe-cli archive create --manifest D:\manifests\{nowutc}.json.zip D:\storage\backups\repo::{user}-{nowutc} C:\misc
8BitSafe-cli archive create -c zstd,fast --abort-on-missing D:\backups\repo::{user}-{nowutc} C:\company_docs
With global options
- Windows
- Unix
8BitSafe-cli.exe --background --filelog archive create -c lz4 D:\storage\backups\repo::{user}-{nowutc} C:\important_docs "C:\Users\Bob\My Images" -e "*.pdf"
8BitSafe-cli --background --filelog archive create -c lz4 D:\storage\backups\repo::{user}-{nowutc} C:\important_docs "C:\Users\Bob\My Images" -e "*.pdf"