Install powershell
Following the documentation here: Installing PowerShell on Ubuntu - PowerShell | Microsoft Docs
# Update the list of packages
sudo apt-get update
# Install pre-requisite packages.
sudo apt-get install -y wget apt-transport-https software-properties-common
# Download the Microsoft repository GPG keys
wget -q https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb
# Register the Microsoft repository GPG keys
sudo dpkg -i packages-microsoft-prod.deb
# Update the list of packages after we added packages.microsoft.com
sudo apt-get update
# Install PowerShell
sudo apt-get install -y powershell
# Start PowerShell
pwsh
Create the folder where duplicacy resides:
mkdir /var/zz/duplicacy/.duplicacy
cd /var/zz/duplicacy/.duplicacy
Download duplicacy executable:
curl -L https://github.com/gilbertchen/duplicacy/releases/download/v2.7.2/duplicacy_linux_x64_2.7.2 -o duplicacy.exe
Clone duplicacy utils:
git clone https://github.com/TheBestPessimist/duplicacy-utils
Update the user config:
nano duplicacy-utils/config.user.ps1
This is what i use:
$duplicacyExePath = ".duplicacy/duplicacy.exe"
$duplicacyBackupNumberOfThreads = 20
$telegramToken = 123456
$mergeNotificationsIntoOne = $true
$scheduledTaskRandomDelay = (New-TimeSpan -Minutes 5)
$scheduledTaskRepetitionInterval = (New-TimeSpan -Hours 12)
Test-run duplicacy-utils
pwsh duplicacy-utils/backup.ps1
Create the scheduled task via systemd
pwsh duplicacy-utils/create-scheduled-tasks/create-scheduled-task-linux-systemd.ps1
Symlink the folders which will be backed up
ln -sf /var/discourse/containers/ /var/zz/duplicacy/discourse__containers_link
ln -sf /var/discourse/shared/web/backups/ /var/zz/duplicacy/discourse__shared__web__backups_link
ln -sf /var/discourse/shared/web/uploads/ /var/zz/duplicacy/discourse__shared__web__uploads_link
ln -sf /var/zz /var/zz/duplicacy/var__zz_link
Set up the filters file
echo "@/var/zz/duplicacy/.duplicacy/duplicacy-utils/filters/filters_general_usage" > filters
echo "e:var__zz_link/duplicacy/" >> filters