chore: improve justfiles
This commit is contained in:
9
justfile
9
justfile
@@ -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")"' _ {} \;
|
||||
|
||||
14
systemd/recurring-tasks/grafana-cold-backup.service
Normal file
14
systemd/recurring-tasks/grafana-cold-backup.service
Normal 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
|
||||
11
systemd/recurring-tasks/grafana-cold-backup.timer
Normal file
11
systemd/recurring-tasks/grafana-cold-backup.timer
Normal 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
|
||||
|
||||
14
systemd/recurring-tasks/grafana-hot-backup.service
Normal file
14
systemd/recurring-tasks/grafana-hot-backup.service
Normal 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
|
||||
11
systemd/recurring-tasks/grafana-hot-backup.timer
Normal file
11
systemd/recurring-tasks/grafana-hot-backup.timer
Normal 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
|
||||
|
||||
Reference in New Issue
Block a user