huangning
2026-07-17 6e62407bd607b18f2e0ca61c5ca8f0aa7008ffba
1
2
3
4
5
6
7
8
9
10
11
$ErrorActionPreference = "Stop"
 
$root = Split-Path -Parent (Split-Path -Parent $MyInvocation.MyCommand.Path)
$dataFile = Join-Path $root "data\crm_full_data.json"
$backupDir = Join-Path $root "backups"
$stamp = Get-Date -Format "yyyyMMdd_HHmmss"
 
New-Item -ItemType Directory -Force -Path $backupDir | Out-Null
Copy-Item -LiteralPath $dataFile -Destination (Join-Path $backupDir "crm_full_data_$stamp.json") -Force
 
Write-Host "Backup created: $backupDir\crm_full_data_$stamp.json"