$timestamp = Get-Date -Format "yyyy-MM-dd_HHmmss" $backupDir = "C:\Users\admin\clawd\backups" $backupFile = "$backupDir\backup_$timestamp.zip" Write-Host "Creating Clawdbot backup: $backupFile" -ForegroundColor Green $tempBase = "C:\Users\admin\.clawdbot-backup-temp" Remove-Item -Recurse -Force $tempBase -ErrorAction SilentlyContinue | Out-Null $tempDir = "$tempBase\clawd" xcopy "C:\Users\admin\clawd\skills" "$tempDir\skills\" /E /I /Q 2>$null | Out-Null xcopy "C:\Users\admin\clawd\projects" "$tempDir\projects\" /E /I /Q 2>$null | Out-Null xcopy "C:\Users\admin\clawd\docs" "$tempDir\docs\" /E /I /Q 2>$null | Out-Null xcopy "C:\Users\admin\clawd\memory" "$tempDir\memory\" /E /I /Q 2>$null | Out-Null xcopy "C:\Users\admin\.clawdbot\agents\main\agent" "$tempDir\agents\" /E /I /Q /EXCLUDE:C:\Users\admin\clawd\backup-exclude.txt 2>$null | Out-Null Compress-Archive -Path "$tempDir\*" -DestinationPath $backupFile -Force Remove-Item -Recurse -Force $tempBase 2>$null | Out-Null $sizeMB = [math]::Round((Get-Item $backupFile).Length / 1MB, 2) Write-Host "Backup complete: $backupFile ($sizeMB MB)" -ForegroundColor Green