Add backup-websites script

Add a bash script that downloads and backs up my static websites from my
server onto my laptop.
This commit is contained in:
Oliver Davies 2025-03-27 18:49:12 +00:00
parent 874ede426e
commit 522b4362b3
3 changed files with 15 additions and 0 deletions

View file

@ -0,0 +1,13 @@
{ lib, pkgs, ... }:
pkgs.writeShellApplication {
name = "backup-websites";
text = ''
backup_path="''${HOME}/server-backup"
mkdir -p "''${backup_path}"
${lib.getExe pkgs.rsync} -avzP ssh.oliverdavies.uk:/var/www/vhosts/ "''${backup_path}" --delete-after
'';
}