Simple local+cloud backups with Duplicacy
I’ve started using Duplicacy to do my backups. It’s marketed as a ‘cross-platform cloud backup tool’ and I’ve been happy with it so far. I previously used Duplicati 1 but found it be extremely slow preparing the list of files to back up. In comparison, Duplicacy has been fast and easy to use.
Although I originally tried the GUI version of Duplicacy, I found the CLI to be more to my liking. The CLI version is free for personal use, but if you do find it useful, I suggest paying for a personal license to support the developer.
Duplicacy CLI quick start
Here’s a quick run down of how to get Duplicacy up and running in a few minutes using the CLI:
- Create a folder
.duplicacy
in the root of the location you wish to back up (this is called the repository). All files and directories to be backed up must be under this root.</p> -
Create a file
filters
in the.duplicacy
. Thefilters
file allows you to set up what files and directories to back up using wildcard matching. A complete description of this is in Duplicacy User Guide. For a Windows system, an examplefilters
file is provided here. This includes some directories underusers/John Doe
, excludes anunwanted_directory/
, includesplease_back_up_another_wanted_directory/
under the root, but excludes all other directories under the root by default, as well as unwanted WindowsThumbs.db
,desktop.ini
,~*
, shortcuts, and directories marked with_del*
. - Initialise the repository for backup by setting the default storage location for the backup by running:
`cd root_folder`
`duplicacy init <snapshot id e.g. COMPUTER1-user-C> <backup storage location e.g. \\network\folder> -e`
This command will create storage named `default` for this repository. The `-e` option enables encryption. Duplicacy will ask for the encryption password when you execute the command.
- Do a dry run to check everything is set up correctly:
`duplicacy backup -dry-run -stats`
- Modify any settings (e.g. the
filters
file) as needed, and when ready run the backup proper:
`duplicacy backup`
- Obviously, the above command can be run whenever you want to do a backup.
Multiple storage locations using the copy
command
A useful feature of Duplicacy is you can add multiple storage locations for each backup repository. You can then use the copy
command to copy the backup from one storage to another. In addition, the copy
command can be run from a different computer than the one containing the initial repository. Therefore, it is possible to have a repository on Laptop1 that is backed up to a (local) network storage location (e.g. shared directory) on Desktop1. On Desktop1, you can add an additional cloud storage location for that backup and run copy
to copy the back up to the cloud, ensuring that you have two copies of the backup in different locations, and with the copying running in the background on a computer with a more reliable network connection.
To set up the above scenario, follow these steps:
- On the computer that is doing the copy, run:
cd backup_storage_location_root
(e.g./backups/duplicacy
)
`duplicacy init <snapshot id e.g. COMPUTER1-user-C> <backup storage location e.g. /backups/duplicacy/computer1> -storage-name <name e.g. default_computer1> -e`
This initialises a repository with storage of the provided name at the specified location. (If `-storage-name` isn’t used, the name `default` will be used, but I suggest a more descriptive name in the case where you want to use the same root directory to store multiple backups). If you have already run `init` for a different backup here, you can instead add the storage as follows:
`duplicacy add <name e.g. default_computer2> <snapshot id e.g. COMPUTER2-user-C> <backup storage location e.g. /backups/duplicacy/computer2> -e`
- Add a cloud storage location:
`duplicacy add <name e.g. GoogleDrive_myaccount_computer1> <snapshot id e.g. COMPUTER1-user-C> <backup storage location e.g. "gcd://duplicacy/computer" -copy <original storage name e.g. default_computer1> -e`
This adds a new storage location; the `-copy` commands ensures that is compatible with the original storage.
- Do the copy:
`duplicacy copy -from <original storage name e.g. default_computer1> -to <new storage name e.g. GoogleDrive_myaccount_computer1>`
- Obviously, you will need to recopy whenever you do a new backup to the local folder.
Note: For Windows users, the doskey
command can be used to make an alias for Duplicacy:
doskey duplicacy="path\to\duplicacy_win_x64_2.1.1.exe" $*