Compare commits
2 commits
506912ff09
...
e237eb678b
| Author | SHA1 | Date | |
|---|---|---|---|
| e237eb678b | |||
|
|
7f508bdc34 |
1 changed files with 33 additions and 0 deletions
|
|
@ -217,3 +217,36 @@ UNIT
|
||||||
systemctl --user daemon-reload
|
systemctl --user daemon-reload
|
||||||
systemctl --user enable --now hiy-update.timer
|
systemctl --user enable --now hiy-update.timer
|
||||||
echo "[hiy] Auto-update timer installed: systemctl --user status hiy-update.timer"
|
echo "[hiy] Auto-update timer installed: systemctl --user status hiy-update.timer"
|
||||||
|
|
||||||
|
# ── Install systemd timer for daily backup ────────────────────────────────────
|
||||||
|
BACKUP_SERVICE="$SERVICE_DIR/hiy-backup.service"
|
||||||
|
BACKUP_TIMER="$SERVICE_DIR/hiy-backup.timer"
|
||||||
|
|
||||||
|
cat > "$BACKUP_SERVICE" <<UNIT
|
||||||
|
[Unit]
|
||||||
|
Description=HIY daily backup
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
Environment=PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/$(id -un)/.local/bin
|
||||||
|
ExecStart=${SCRIPT_DIR}/backup.sh
|
||||||
|
StandardOutput=journal
|
||||||
|
StandardError=journal
|
||||||
|
UNIT
|
||||||
|
|
||||||
|
cat > "$BACKUP_TIMER" <<UNIT
|
||||||
|
[Unit]
|
||||||
|
Description=HIY daily backup at 03:00
|
||||||
|
|
||||||
|
[Timer]
|
||||||
|
OnCalendar=*-*-* 03:00:00
|
||||||
|
Persistent=true
|
||||||
|
Unit=hiy-backup.service
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=timers.target
|
||||||
|
UNIT
|
||||||
|
|
||||||
|
systemctl --user daemon-reload
|
||||||
|
systemctl --user enable --now hiy-backup.timer
|
||||||
|
echo "[hiy] Backup timer installed: systemctl --user status hiy-backup.timer"
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue