feat(yedek): günlük MongoDB yedeği, geri yükleme ve bu bilgisayara kopya
- scripts/backup.sh: mongodump + bütünlük denetimi, son 14 yedek - scripts/restore.sh: ayrı veritabanına geri yükleme ve sayım karşılaştırma - scripts/backup-pull.sh + systemd zamanlayıcıları; kurulum docs/DEPLOY.md §6 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
# Bu bilgisayar: ~/.config/systemd/user/kakeibo-backup-pull.service
|
||||
[Unit]
|
||||
Description=Kakeibo yedeklerini sunucudan çek
|
||||
Wants=network-online.target
|
||||
After=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
# ~/.ssh/config'teki sunucu adı "atlas" değilse başındaki # işaretini kaldırıp düzeltin
|
||||
#Environment=KAKEIBO_BACKUP_HOST=atlas
|
||||
ExecStart=%h/Developer/Rust/kakeibo/scripts/backup-pull.sh
|
||||
@@ -0,0 +1,12 @@
|
||||
# Bu bilgisayar: ~/.config/systemd/user/kakeibo-backup-pull.timer
|
||||
[Unit]
|
||||
Description=Kakeibo yedeklerini her gün çek
|
||||
|
||||
[Timer]
|
||||
# Sunucudaki yedekten sonra; bilgisayar kapalıysa açıldıktan 10 dk sonra
|
||||
OnCalendar=*-*-* 09:00:00
|
||||
OnStartupSec=10min
|
||||
Persistent=true
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
||||
@@ -0,0 +1,13 @@
|
||||
# Atlas (sunucu): /etc/systemd/system/kakeibo-backup.service
|
||||
[Unit]
|
||||
Description=Kakeibo MongoDB günlük yedeği
|
||||
Wants=docker.service
|
||||
After=docker.service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
# Yedeği çeken SSH kullanıcısı root değilse: başındaki # işaretini kaldırıp grubunu yazın.
|
||||
#Environment=BACKUP_GROUP=<ssh-kullanıcınız>
|
||||
ExecStart=/usr/local/lib/kakeibo/backup.sh
|
||||
Nice=10
|
||||
IOSchedulingClass=idle
|
||||
@@ -0,0 +1,12 @@
|
||||
# Atlas (sunucu): /etc/systemd/system/kakeibo-backup.timer
|
||||
[Unit]
|
||||
Description=Kakeibo yedeği her gece 03:30
|
||||
|
||||
[Timer]
|
||||
OnCalendar=*-*-* 03:30:00
|
||||
# Sunucu o saatte kapalıysa açılınca hemen çalışır
|
||||
Persistent=true
|
||||
RandomizedDelaySec=5m
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
||||
Reference in New Issue
Block a user