.\" generated with Ronn-NG/v0.9.1 .\" http://github.com/apjanke/ronn-ng/tree/0.9.1 .SH "SYNOPSIS" Bupstash encrypted and deduplicated backups\. .P Run one of the following \fBbupstash\fR subcommands\. .P \fBbupstash init \|\.\|\.\|\.\fR .br \fBbupstash new\-key \|\.\|\.\|\.\fR .br \fBbupstash new\-sub\-key \|\.\|\.\|\.\fR .br \fBbupstash put \|\.\|\.\|\.\fR .br \fBbupstash list \|\.\|\.\|\.\fR .br \fBbupstash list\-contents \|\.\|\.\|\.\fR .br \fBbupstash diff \|\.\|\.\|\.\fR .br \fBbupstash get \|\.\|\.\|\.\fR .br \fBbupstash restore \|\.\|\.\|\.\fR .br \fBbupstash rm \|\.\|\.\|\.\fR .br \fBbupstash recover\-removed \|\.\|\.\|\.\fR .br \fBbupstash gc \|\.\|\.\|\.\fR .br \fBbupstash sync \|\.\|\.\|\.\fR .br \fBbupstash exec\-with\-locks \|\.\|\.\|\.\fR .br \fBbupstash serve \|\.\|\.\|\.\fR .br \fBbupstash help \|\.\|\.\|\.\fR .br \fBbupstash version \|\.\|\.\|\.\fR .br .SH "DESCRIPTION" \fBbupstash\fR is a tool for storing (and retrieving) files and data in an encrypted bupstash\-repostory(7)\. .P Some notable features of \fBbupstash\fR include: .IP "\[ci]" 4 Automatic deduplication of stored data\. .IP "\[ci]" 4 Client side encryption of data\. .IP "\[ci]" 4 Incremental file uploads\. .IP "\[ci]" 4 A tag based query language\. .IP "\[ci]" 4 Optional role based encryption and decryption key separation\. .IP "\[ci]" 4 Remote repositories over ssh ssh\. .IP "\[ci]" 4 Optional, per ssh key access repository controls\. .IP "\[ci]" 4 A multi layered approach to security\. .IP "" 0 .P The \fBbupstash\fR tool itself is divided into subcommands that each have their own documentation\. .SH "SUBCOMMANDS" .TP bupstash\-init(1) Initialize a bupstash repository\. .TP bupstash\-new\-key(1) Create a new primary key for creating/reading repository items\. .TP bupstash\-new\-sub\-key(1) Derive a sub key for a subset of operations\. .TP bupstash\-put(1) Add data to a bupstash repository\. .TP bupstash\-get(1) Fetch data from the bupstash repository matching a query\. .TP bupstash\-restore(1) Restore a snapshot into a local directory\. .TP bupstash\-list(1) List repository items matching a given query\. .TP bupstash\-list\-contents(1) List directory snapshot contents\. .TP bupstash\-diff(1) Diff snapshot contents\. .TP bupstash\-rm(1) Remove repository items matching a given query\. .TP bupstash\-recover\-removed(1) Recover removed items that are pending garbage collection\. .TP bupstash\-gc(1) Reclaim diskspace in a repository\. .TP bupstash\-sync(1) Sync items between repositories\. .TP bupstash\-exec\-with\-locks(1) Exec a command with exclusive locks held on the repository\. .TP bupstash\-serve(1) Serve a repository over stdin/stdout using the bupstash\-protocol(7)\. .SH "EXAMPLES" .SS "Initialize a repository and create keys" \fB$ bupstash init \-r ssh://$SERVER/home/me/backups $ bupstash new\-key \-o backups\.key\fR .SS "Tell bupstash to use our repository and key by default" \fB$ export BUPSTASH_REPOSITORY=ssh://$SERVER/home/me/backups $ export BUPSTASH_KEY=backups\.key\fR .SS "Directory snapshots" ``` $ bupstash put \./some\-data ebb66f3baa5d432e9f9a28934888a23d .P $ bupstash list\-contents id=ebb66f3baa5d432e9f9a28934888a23d drwxr\-xr\-x 0 2020/11/05 10:42:48 \. \-rw\-r\-\-r\-\- 177B 2020/07/12 17:13:42 data\.txt ``` .SS "List items matching a query" \fB$ bupstash list hostname=$(hostname) id="bcb8684e6bf5cb453e77486decf61685" name="some\-file\.txt" hostname="my\-server" timestamp="2020\-07\-27 11:26:16" \|\.\|\.\|\.\fR .SS "Incremental uploads" ``` $ bupstash put \-\-send\-log /var/backup\.sendlog \./some\-data ebb66f3baa5d432e9f9a28934888a23d$ bupstash put \-\-send\-log /var/backup\.sendlog \./some\-data ebb66f3baa5d432e9f9a28934888a23d ``` .SS "Capture and save command output" \fB# Checks for errors before saving new item\. $ bupstash put \-\-exec name=database\.sql pgdump mydatabase 14ebd2073b258b1f55c5bbc889c49db4\fR .SS "Get an item matching a query" \fB$ bupstash get id=bcb8684e6bf5cb453e77486decf61685 some data\.\fR .SS "Restore a directory to a previous snapshot" \fB$ bupstash restore \-\-to \./dir name=dir\.tar\fR .SS "Remove items matching a query\." \fB$ bupstash rm name=some\-data\.txt\fR .SS "Wipe a repository" \fB$ bupstash rm \-\-allow\-many id=*\fR .SS "Reclaim disk space" \fB$ bupstash gc\fR .SS "Offline decryption keys" ``` # Create a key, a put only key, and a metadata (list/rm only) key\. $ bupstash new\-key \-o backups\.key $ bupstash new\-sub\-key \-\-put \-k backups\.key \-o backups\-put\.key $ bupstash new\-sub\-key \-\-list \-k backups\.key \-o backups\-metadata\.key .P \|\.\|\.\|\. Copy backups\.key to secure offline storage \|\.\|\.\|\.$ shred backups\.key .P $ bupstash put \-k backups\-put\.key \./data 14ebd2073b258b1f55c5bbc889c49db4 .P \|\.\|\.\|\. When you need to list or remove backups, you may use the metadata key \|\.\|\.\|\. .P $ bupstash list \-k backups\-metadata\.key \|\.\|\.\|\. $ bupstash rm \-k backups\-metadata\.key .P \|\.\|\.\|\. After emergency, get decryption key from offline storage \|\.\|\.\|\.$ bupstash get \-k backups\.key id=14ebd2073b258b1f55c5bbc889c49db4 | tar \-C \./restore \-xf \- ``` .SH "SEE ALSO" bupstash\-repository(7), bupstash\-keyfiles(7)