Desinger-System / scripts /backup_db.ps1
o134's picture
Upload scripts
7092a30 verified
Raw
History Blame Contribute Delete
429 Bytes
# 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."
}