How to use Duplicacy to backup to Storj cloud storage
Introduction
Duplicacy is a cross-platform cloud backup tool with client-side encryption and fast performance.
Available as a web-based GUI or a command line tool.
Excellent performance and uses Lock Free Deduplication.
A software license is required but the command-line interface (CLI) version is free for personal use.
Extensive storage backend support.
We'll use the CLI version for this tutorial to back up to Storj cloud storage.
Installation
Packages
Pre-compiled binaries are available for Linux, macOS, and Windows directly from the Duplicacy GitHub repository.
Download the latest version for your system. The current version is 3.2.3
.
Change the file mode bit.
Preparing a new repository
The duplicacy init command initializes the storage.
The <snapshot id>
refers to the name of the backup job.
The <storage url>
refers to the storage location of the backup job.
The duplicacy init
command has multiple options, but we'll only be using the following:
We'll initialize the repository using the duplicacy init
command and these options in the next section.
Storj cloud storage
The Storj cloud provider offers decentralized storage built for performance with an open-source architecture.
The free tier offers 150 GB of free storage.
To backup data via Storj
, create a storage bucket and API key from their website.
Sign up for a free account.
Create a new storage bucket and passphrase. The passphrase is not used for
Duplicacy
because you have an API key. However, it is a requirement for the storage bucket.Create an API key. Navigate to the Access page and click the Create Keys for CLI link (rightmost option). Provide name, permissions, and optionally buckets, and select Create Keys.
Copy and save the Satellite Address and API key in a safe place or download them because they will only appear once.
You will need the Satellite Address and API key to initialize your repository.
Here is the format:
The <storage url>
for Storj
uses the following format:
Optional performance parameters
Duplicacy
uses a unique pack-and-split method to split files into chunks with a default chunk size
of 4 MiB
.
Increase the chunk size
for better performance with Storj
buckets.
Here is the complete command for this example:
Here is the output:
Please note the following prompts:
Copy and paste in your API key.
Copy and paste in a passphrase you would like to use.
Saving configuration information
Duplicacy
automatically creates a configuration folder named .duplicacy
when the initialization is complete. The preferences file in this directory contains the configuration data.
The duplicacy set command allows you to store your keys and passphrase in the configuration file to avoid manually inputting them when backing up or restoring files.
Setting this will allow you to automate your backups with bash scripts or schedule them via cron jobs.
Go to the official Duplicacy wiki for a complete list of environment variables.
We'll be setting the following variable keys:
Here is the complete command for our example:
You can run the backup command without being prompted to provide your credentials when finished.
Backing up
Use the duplicacy backup command to back up your data.
Here is the complete command using our example:
Here is the output:
Duplicacy
assigns a revision number starting with one and increments it every time you run the backup.
Here is what a second backup will look like if there are no file changes.
Restoring files
Use the duplicacy restore command to restore files from your backups.
The duplicacy restore
command has multiple options, but we'll only be discussing the following:
To restore the entire snapshot from the initial backup, run the following command:
Here is the output:
Only restores missing files.
The overwrite option is needed to overwrite existing files.
The overwrite option only overwrites existing files that have changed.
The overwrite option will be ignored if there are no file changes.
To restore specific files, specify a pattern.
To restore all files with the .png extension:
To restore a file named profile.png:
See more details about the restore option.
Listing files in the backups
Use the duplicacy list command is used to list files in the backup snapshots.
The duplicacy list
command has multiple options, but we'll only be discussing the following:
To list the files from a 4th backup:
Here is the output:
Conclusion
Duplicacy
is a powerful backup tool and this tutorial is only a brief introduction of what it has to offer. Check out the Duplicacy forum for complete documentation and helpful community support.