$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"
|