From c6a55eb2d5e17840bd282fd795729e176593ca56 Mon Sep 17 00:00:00 2001 From: Roger Sikorski Date: Sun, 4 Sep 2022 12:37:12 +0200 Subject: [PATCH] First commit --- CreateBackup.ps1 | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 CreateBackup.ps1 diff --git a/CreateBackup.ps1 b/CreateBackup.ps1 new file mode 100644 index 0000000..f85f613 --- /dev/null +++ b/CreateBackup.ps1 @@ -0,0 +1,8 @@ +[string]$backup_path="C:\Users\roger\SynologyDrive\Archiv\Backups\WSL\" +[string]$distro_name="Ubuntu-22.04" + +Write-Output "Creating WSL Backup of distribution $distro_name..." + +Get-ChildItem -Path $backup_path | Sort-Object LastWriteTime -Descending | Select-Object -Skip 3 | Remove-Item +#wsl --export $distro_name $backup_path\$distro_name_$((Get-Date).ToString('yyyy-MM-dd')).tar +wsl --export $distro_name $backup_path\$distro_name.tar