Spaces:
Runtime error
Runtime error
| # Backup SQLite local.db | |
| $timestamp = Get-Date -Format "yyyyMMdd_HHmmss" | |
| $backupDir = "backups" | |
| $sourceFile = "local.db" | |
| $destFile = "$backupDir/local_$timestamp.db" | |
| if (-not (Test-Path $backupDir)) { | |
| New-Item -ItemType Directory -Path $backupDir | |
| } | |
| if (Test-Path $sourceFile) { | |
| Copy-Item $sourceFile $destFile | |
| Write-Host "Backup created: $destFile" | |
| } else { | |
| Write-Warning "Source file $sourceFile not found." | |
| } | |