Plakar command line syntax
Last reviewed: 2025-09-04 / Plakar v1.0.3
Plakar intends to provide a simple and intuitive command line interface for managing your backups.
There are two syntaxes available: the simple syntax and the rich syntax.
Simple Syntax
With the simple syntax, you can directly use the path to the resource. For example:
1# List the contents of the Kloset store located at /var/backups
2plakar at /var/backups ls
3
4# Back up the directory /etc into the default Kloset store, stored at ~/.plakar
5plakar backup /etc
6
7# Back up the directory /etc into a specific Kloset store
8plakar at /var/backups backup /etc
9
10# Restore the contents of the snapshot dc60f09a located in the default Kloset store at ~/.plakar into ./restore-dir
11plakar restore -to ./restore-dir dc60f09a
12
13# Restore the contents of the snapshot dc60f09a located in the Kloset store at /var/backups into ./restore-dir
14plakar at /var/backups restore -to ./restore-dir dc60f09a
The simple syntax is not limited to the filesystem. You can, for example, specify a store exposed by plakar server
(requires the package http
):
1plakar at http://127.0.0.1:9876/ ls
Or back up using the SFTP integration (requires the sftp
package):
1plakar at /var/backups backup sftp://myserver/etc/resolv.conf
You can also use the sftp
package to access a Kloset store hosted on an SFTP server:
1plakar at sftp://myserver/var/backups backup ./myfolder
Or even back up an SFTP server to a store hosted on another SFTP server:
1plakar at sftp://myserver/var/backups backup sftp://anotherserver/etc
Rich syntax
Some integrations require additional parameters. For example, the S3 integration requires an access key and a secret key. In this case, Plakar provides a rich syntax to reference resources configured with plakar store
, plakar source
and plakar destination
.
Let’s look at some examples by creating a configuration for a Kloset store on a local MinIO instance:
1plakar store add myminio s3://localhost:9000/mybackups access_key=minioadmin secret_access_key=minioadmin use_tls=false passphrase=mysecretpassphrase
To reference the store in Plakar commands, use the @
syntax:
1plakar at @myminio create
2plakar at @myminio backup /etc
The syntax works exactly the same to reference a source to back up:
1# Configure the source
2plakar source add mybucket s3://localhost:9000/mybucket access_key=minioadmin secret_access_key=minioadmin use_tls=false
3
4# Back up mybucket into the default Kloset store, located at ~/.plakar
5plakar backup @mybucket
Or destinations:
1# Configure the destination
2plakar destination add mybucket s3://localhost:9000/mybucket access_key=minioadmin secret_access_key=minioadmin use_tls=false
3
4# Restore the path /etc/resolv.conf of the snapshot dc60f09a located in the default Kloset store at ~/.plakar into the bucket
5plakar restore -to @mybucket dc60f09a:/etc/resolv.conf
You can also mix these parameters to back up a source specified in the configuration to a Kloset store specified in the configuration:
1plakar at @myminio backup @mybucket