2 Commits

Author SHA1 Message Date
73ad6dd06a scripts(backup-notifications): unify push + email format across VDS/RUVDS/windows-host
3 host-pipelines (VDS bash, RUVDS+windows-host ps1) had drifted formats:
ntfy title `VDS backup OK $D` vs `RUVDS backup OK ($D)`, tags
`white_check_mark` vs `green_circle`, email subject `[VDS] backup OK` vs
`RUVDS backup -- SUCCESS`. Phone-side фильтрация и desktop reading
ломались за счёт inconsistency.

Unified to:
- ntfy push: title `<HOST> backup OK <date>`, body
  `<duration_human>, size=<>, snapshots=<>, dest=kreknin:<>`,
  tags `green_circle` (OK) / `red_circle` (FAILED).
- email: subject `[<HOST>] backup <STATUS> <date>` (STATUS=OK|FAILED),
  body — structured Date/Duration/Size/Snapshots/Source/Dest/Components/Log.
  Failure body extends with `Tail (last 40 lines)`.

Also imports VDS `run.sh` into repo as `scripts/vds-backup-rsync-kreknin/`
— closes drift из общего `scripts/<slug>/` pattern (RUVDS+windows-host
уже жили там; VDS жил только на /opt/stacks/backup/scripts/).

Deploy status:
- VDS: deployed via scp + sudo install, sha256=27b09ca272bb, smoke ntfy+email ✓
- RUVDS: deployed via scp + Move-Item, sha256=f3bb57a86af5, smoke ntfy+email ✓
- windows-host: deploy.ps1 + smoke-notify.ps1 готовы в scripts/, **pending
  elevated PS у user'а** (ACL=SYSTEM+Administrators, не пишется без UAC).

Spec + decisions + completed: .tasks/unify-backup-notifications.md.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 07:19:15 +03:00
9980538f78 scripts(windows-host-fallback-backup-daily): add setup.ps1 + run.ps1 + README
Daily backup windows-host (DESKTOP-NSEF0UK) → kreknin via rclone SFTP.
Pattern parallels ruvds-backup-daily-kreknin 🟢.

Components (5):
- MSSQL container: docker exec BACKUP DATABASE × 5 DBs (MoreThenCms,
  StayerCalculator, StayerPrice, stostayer, TireService) с COMPRESSION,
  INIT, FORMAT → docker cp → rclone sync
- Sites: C:\sites\
- MinIO data: C:\Users\vitya\projects\docker\diskstation\minio\data
- Traefik: C:\Users\vitya\projects\docker\diskstation\traefik\
- IIS config: applicationHost.config + Backup-WebConfiguration export

Schedule: daily 03:00 MSK (sequential с RUVDS 04:30 + VDS 05:00).
Wake-To-Run enabled — машина просыпается из standby на backup.
SYSTEM principal (full access к C:\sites + Cert store + IIS metadata).
Retention 7 daily snapshots.

Notifications: dual-channel — ntfy `vds-backup` topic (shared) + email
via Yandex SMTP 587 STARTTLS, noreply@snolla.com → ops gmail. Same
creds как другие backup pipelines.

Decisions log в README:
- rclone в `C:\ProgramData\backup\rclone.exe` (не Program Files) —
  избегаем admin requirement на user-context staging.
- icacls SID `*S-1-5-32-544` (well-known Administrators) — locale-safe
  для RU/EN Windows (BUILTIN\Administrators не парсится на ru-locale).
- MSSQL backup via sqlcmd 18 с -C (trust cert) — TLS-required даже на
  localhost в новых mssql tools.
- MSSQL_SA_PASS в config.env (windows-host не имеет pass setup); TODO
  pass-on-Windows long-term.

Pre-staging уже сделано (ssh-key + kreknin authorized_keys via VDS
pivot, rclone в ProgramData, SFTP smoke OK). setup.ps1 (elevated)
пройдёт idempotent через staged steps, only Register-ScheduledTask
fresh.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 13:38:31 +03:00