chore: improve justfiles

This commit is contained in:
2025-12-20 07:35:12 +01:00
parent 0588cc60da
commit 28fe639771
5 changed files with 59 additions and 0 deletions

View File

@@ -2,3 +2,12 @@ copy-systemd-services:
sudo cp ./systemd/recurring-tasks/*.service /etc/systemd/system && \
sudo cp ./systemd/recurring-tasks/*.timer /etc/systemd/system && \
sudo systemctl daemon-reload
backup-all:
find ./systemd/recurring-tasks -type f -name "*.service" -exec bash -c 'sudo systemctl restart "$(basename "$1")"' _ {} \;
status-services:
find ./systemd/recurring-tasks -type f -name "*.service" -exec bash -c 'sudo systemctl status "$(basename "$1")"' _ {} \;
status-timers:
find ./systemd/recurring-tasks -type f -name "*.timer" -exec bash -c 'sudo systemctl status "$(basename "$1")"' _ {} \;

View File

@@ -0,0 +1,14 @@
[Unit]
Description=Backup Syncthing - Cold
After=network.target
[Service]
ExecStart=homeassistant-backup --mode cold --sourceFolder /mnt/usb/grafana/hot --targetFolder /mnt/usb/grafana/cold --backupName grafana
WorkingDirectory=/etc/grafana
Restart=off
User=willem
Environment=PATH=/usr/bin:/usr/local/bin
Environment=NODE_ENV=production
[Install]
WantedBy=multi-user.target

View File

@@ -0,0 +1,11 @@
[Unit]
Description=Run grafana cold backup Service every day
[Timer]
OnBootSec=1min
OnUnitActiveSec=1day
Persistent=true
[Install]
WantedBy=timers.target

View File

@@ -0,0 +1,14 @@
[Unit]
Description=Backup Syncthing - Hot
After=network.target
[Service]
ExecStart=homeassistant-backup --mode hot --sourceFolder /etc/grafana --targetFolder /mnt/usb/grafana/hot --backupName grafana
WorkingDirectory=/etc/grafana
Restart=off
User=willem
Environment=PATH=/usr/bin:/usr/local/bin
Environment=NODE_ENV=production
[Install]
WantedBy=multi-user.target

View File

@@ -0,0 +1,11 @@
[Unit]
Description=Run Grafana hot backup Service every hour
[Timer]
OnBootSec=1min
OnUnitActiveSec=1hour
Persistent=true
[Install]
WantedBy=timers.target