Work in progress. DO NOT use in production.
Duplicacy Manager is a PowerShell wrapper on Duplicacy CLI that allows managing backups efficiently.
Duplicacy CLI (Command Line Interface) is free for personal use and commercial trial. Commercial use of Duplicacy CLI requires per-user licenses available from Duplicacy website.
- Cross-platform – runs on any platform supported by Duplicacy (Linux, MacOS, Windows)
- Convention over configuration – sensible defaults that may be changed if needed
- Fire&forget – self auto-update and Duplicacy auto-update
- Quiet – bother user only if something went wrong
- Simple, one-file download – self-contained single binary or script, easy to download and use
- Properly licensed – permission for private and commercial use
-
Execute PowerShell as Administrator (with elevated privileges)
-
Windows 10
Windows 10 comes with a Cortana search box in the taskbar. Type
powershellin the search box and click onWindows PowerShellon the results and selectRun as administrator.
-
-
Create
C:\Backupdirectory (folder) and change current directory to itPS C:\WINDOWS\system32> mkdir C:\Backup PS C:\WINDOWS\system32> cd C:\Backup
-
Change Execution Policy in PowerShell
PS C:\Backup> Set-ExecutionPolicy unrestricted
-
Download Duplicacy Manager script from https://raw.githubusercontent.com/octivi/duplicacy-manager/powershell/backup.ps1 and save it to the newly created
C:\Backupdirectory -
Download Duplicacy CLI binary
PS C:\Backup> C:\Backup\backup.ps1 updateDuplicacy -
Initialize backup repository
PS C:\Backup> C:\Backup\backup.ps1 init <backup repository local path> <storage backend> -encrypt
where:
<backup repository local path>is a relative or absolute backup repository local path (the directory is created underC:\Backupdirectory, e.g.backup)<storage backend>is one of the supported by Duplicacy storage backends, e.g.sftp://u00000@u00000.your-storagebox.de/duplicacy
You will be asked to provide a password to storage backend (and other credentials, depends on the selected backend) and password to encrypt the backup.
For example
PS C:\Backup> C:\Backup\backup.ps1 init C:\Backup\backup sftp://u00000@u00000.your-storagebox.de/duplicacy -encrypt
-
Configure the newly initialized backup repository (remember about filters)
-
Add first-level symbolic links to folders or disks you want to back up, for example to backup
C:\andD:\disks create symbolic linksPS C:\Backup> cmd /c mklink /d C:\Backup\backup\C C:\ PS C:\Backup> cmd /c mklink /d C:\Backup\backup\D D:\
-
Update default filters from TheBestPessimist's duplicacy-utils
PS C:\Backup> C:\Backup\backup.ps1 updateFilters -
Create your own filters file in
C:\Backup\backup\.duplicacy\filters. You can useC:\Backup\filters.exampleas an examplePS C:\Backup> copy C:\Backup\filters.example C:\Backup\backup\.duplicacy\filters
-
-
Schedule backup with Windows Task Scheduler
PS C:\Backup> C:\Backup\backup.ps1 schedule <backup repository local path> <list of commands>
where:
<backup repository local path>is a relative or absolute backup repository local path, e.g.backup<list of commands>is a comma-separated list of commands, e.g.backup,prune,check,cleanLogs
For example
PS C:\Backup> C:\Backup\backup.ps1 schedule C:\Backup\backup backup,prune,check,cleanLogs
Usage:
backup.ps1 [-commands] <commands> [[-repositoryPath] <backup repository path>] [[-storage] <storage URL>] [[-scheduleCommands] <commands to schedule>] [<Duplicacy arguments...>]where:
<commands>- List of commands to execute separated by single comma ',' (no spaces), e.g.backup,prune,check,cleanLogs<backup repository path>- Relative or absolute backup repository local path, e.g.C:\Backup\backup<storage backend URL>- One of the supported by Duplicacy storage backends<commands to schedule>- Comma-separated list of commands to schedule, e.g.backup,prune,check,cleanLogs<Duplicacy arguments>- Optional command-specific Duplicacy arguments
Show this help.
backup.ps1 helpClean logs older than 30 days.
backup.ps1 cleanLogs <backup repository path><backup repository path>- Relative or absolute backup repository local path, e.g.C:\Backup\backup
Schedule list of commands to execute, e.g. backup,prune,check,cleanLogs.
backup.ps1 schedule <backup repository path> <commands to schedule><backup repository path>- Relative or absolute backup repository local path, e.g.C:\Backup\backup<commands to schedule>- Comma-separated list of commands to schedule, e.g.backup,prune,check,cleanLogs
Download and update Duplicacy CLI binary from Duplicacy's GitHub repository.
backup.ps1 updateDuplicacyDownload and update filters from TheBestPessimist's GitHub repository.
backup.ps1 updateFiltersDownload and update self from our own GitHub repository.
backup.ps1 updateSelfInitialize a new repository and storage. Invokes Duplicacy init command.
backup.ps1 init <backup repository path> <storage backend> [<Duplicacy init arguments...>]<backup repository path>- Relative or absolute backup repository local path, e.g.C:\Backup\backup<storage backend URL>- One of the supported by Duplicacy storage backends
<Duplicacy init arguments>- Optional Duplicacyinitcommand arguments
Save a snapshot of the repository to the storage. Invokes Duplicacy backup command.
backup.ps1 backup <backup repository path> [<Duplicacy backup arguments...>]<backup repository path>- Relative or absolute backup repository local path, e.g.C:\Backup\backup
<Duplicacy backup arguments>- Optional Duplicacybackupcommand arguments
Check the integrity of snapshots. Invokes Duplicacy check command.
backup.ps1 check <backup repository path> [<Duplicacy check arguments...>]<backup repository path>- Relative or absolute backup repository local path, e.g.C:\Backup\backup
<Duplicacy check arguments>- Optional Duplicacycheckcommand arguments
List snapshots. Invokes Duplicacy list command.
backup.ps1 list <backup repository path> [<Duplicacy list arguments...>]<backup repository path>- Relative or absolute backup repository local path, e.g.C:\Backup\backup
<Duplicacy list arguments>- Optional Duplicacylistcommand arguments
Prune snapshots by retention policy (-all -keep 0:1825 -keep 30:180 -keep 7:30 -keep 1:7). Invokes Duplicacy prune command.
backup.ps1 prune <backup repository path> [<Duplicacy prune arguments...>]<backup repository path>- Relative or absolute backup repository local path, e.g.C:\Backup\backup
<Duplicacy prune arguments>- Optional Duplicacyprunecommand arguments
Duplicacy manager uses Duplicacy symlink mode. This is the only way to create a repository that includes multiple drives on Windows. Duplicacy follows the first-level symlinks (those under the root of the repository). Symlinks located under any subdirectories of the repository are backed up as symlinks and are not followed.
Check Duplicacy documentation.
Example directory structure:
.
├── backup_repository_1
│ └── .duplicacy
│ │ ├── cache
│ │ ├── filters
│ │ ├── logs
│ │ └── preferences
│ ├── C
│ └── D
├── backup_repository_2
│ └── .duplicacy
│ │ ├── cache
│ │ ├── filters
│ │ ├── logs
│ │ └── preferences
│ └── E
├── backup.ps1
├── duplicacy.exe
└── filters.example