.\" generated with Ronn-NG/v0.10.1 .\" http://github.com/apjanke/ronn-ng/tree/0.10.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 "\(bu" 4 Automatic deduplication of stored data\. .IP "\(bu" 4 Client side encryption of data\. .IP "\(bu" 4 Incremental file uploads\. .IP "\(bu" 4 A tag based query language\. .IP "\(bu" 4 Optional role based encryption and decryption key separation\. .IP "\(bu" 4 Remote repositories over ssh ssh\. .IP "\(bu" 4 Optional, per ssh key access repository controls\. .IP "\(bu" 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" .nf $ bupstash init \-r ssh://$SERVER/home/me/backups $ bupstash new\-key \-o backups\.key .fi .SS "Tell bupstash to use our repository and key by default" .nf $ export BUPSTASH_REPOSITORY=ssh://$SERVER/home/me/backups $ export BUPSTASH_KEY=backups\.key .fi .SS "Directory snapshots" .nf $ bupstash put \./some\-data ebb66f3baa5d432e9f9a28934888a23d $ 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 .fi .SS "List items matching a query" .nf $ bupstash list hostname=$(hostname) id="bcb8684e6bf5cb453e77486decf61685" name="some\-file\.txt" hostname="my\-server" timestamp="2020\-07\-27 11:26:16" \|\.\|\.\|\. .fi .SS "Incremental uploads" .nf $ bupstash put \-\-send\-log /var/backup\.sendlog \./some\-data ebb66f3baa5d432e9f9a28934888a23d # Second backup is much faster when it reads the send log\. $ bupstash put \-\-send\-log /var/backup\.sendlog \./some\-data ebb66f3baa5d432e9f9a28934888a23d .fi .SS "Capture and save command output" .nf # Checks for errors before saving new item\. $ bupstash put \-\-exec name=database\.sql pgdump mydatabase 14ebd2073b258b1f55c5bbc889c49db4 .fi .SS "Get an item matching a query" .nf $ bupstash get id=bcb8684e6bf5cb453e77486decf61685 some data\. .fi .SS "Restore a directory to a previous snapshot" .nf $ bupstash restore \-\-to \./dir name=dir\.tar .fi .SS "Remove items matching a query\." .nf $ bupstash rm name=some\-data\.txt .fi .SS "Wipe a repository" .nf $ bupstash rm \-\-allow\-many id=* .fi .SS "Reclaim disk space" .nf $ bupstash gc .fi .SS "Offline decryption keys" .nf # 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 \|\.\|\.\|\. Copy backups\.key to secure offline storage \|\.\|\.\|\. # Remove primary key $ shred backups\.key $ bupstash put \-k backups\-put\.key \./data 14ebd2073b258b1f55c5bbc889c49db4 \|\.\|\.\|\. When you need to list or remove backups, you may use the metadata key \|\.\|\.\|\. $ bupstash list \-k backups\-metadata\.key \|\.\|\.\|\. $ bupstash rm \-k backups\-metadata\.key \|\.\|\.\|\. After emergency, get decryption key from offline storage \|\.\|\.\|\. # Restore by getting an item and decrypting it using the decryption key\. $ bupstash get \-k backups\.key id=14ebd2073b258b1f55c5bbc889c49db4 | tar \-C \./restore \-xf \- .fi .SH "SEE ALSO" bupstash\-repository(7), bupstash\-keyfiles(7)