From 33baa5ce70f5abb14e90fd05f6f1dacb248b5a55 Mon Sep 17 00:00:00 2001 From: iFargle Date: Fri, 15 Dec 2023 21:38:01 +0900 Subject: [PATCH] Update script and timezones on pi's --- nixos/hosts/backups-rpi4/backup-script.nix | 6 +++--- nixos/hosts/backups-rpi4/default.nix | 3 +++ nixos/hosts/piaware-rpi4/default.nix | 3 +++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/nixos/hosts/backups-rpi4/backup-script.nix b/nixos/hosts/backups-rpi4/backup-script.nix index be239dbe..37c76329 100644 --- a/nixos/hosts/backups-rpi4/backup-script.nix +++ b/nixos/hosts/backups-rpi4/backup-script.nix @@ -7,7 +7,7 @@ let GOTIFY_TOKEN=`cat /var/run/secrets/gotify_token | head -n 1` payload="{\"message\": \"Backup has started\nDate: `date`\", \"priority\": 2,\"title\": \"backups-rpi4: Backup Started\"}" -curl -X 'POST' 'https://gotify.sysctl.io/message' -H 'accept: application/json' -H 'Content-Type: application/json' -H 'X-Gotify-Key: $GOTIFY_TOKEN' -d "$payload" +curl -X "POST" "https://gotify.sysctl.io/message" -H "accept: application/json" -H "Content-Type: application/json" -H "X-Gotify-Key: $GOTIFY_TOKEN" -d "$payload" drive1=`lsblk -o NAME,SERIAL | grep -v crypt | grep 9RGHYP8C | awk {'print $1'}` drive2=`lsblk -o NAME,SERIAL | grep -v crypt | grep 9RGXW93C | awk {'print $1'}` @@ -21,7 +21,7 @@ echo "Checking if the NAS is mounted on nuc-docker01:" check=$(ssh root@nuc-docker01 df -h | grep Storage | wc -l) if [[ $check != 3 ]] ; then payload="{\"message\": \"Backup stopped. nuc-docker01 does not have 3 mounts in Storage\nDate: `date`\", \"priority\": 2,\"title\": \"backups-rpi4: Backup Stopped\"}" - curl -X 'POST' 'https://gotify.sysctl.io/message' -H 'accept: application/json' -H 'Content-Type: application/json' -H 'X-Gotify-Key: $GOTIFY_TOKEN' -d "$payload" + curl -X "POST" "https://gotify.sysctl.io/message" -H "accept: application/json" -H "Content-Type: application/json" -H "X-Gotify-Key: $GOTIFY_TOKEN" -d "$payload" exit fi @@ -108,7 +108,7 @@ echo -e "======= Time complete: `date`" echo "Sending completion message" payload="{\"message\": \"Backup completed\nDate: `date`\n`df -h | grep sda`\n`df -h | grep sdb`\n`df -h | grep sdc`\", \"priority\": 2,\"title\": \"backups-rpi4: Backup Complete\"}" -curl -X 'POST' 'https://gotify.sysctl.io/message' -H 'accept: application/json' -H 'Content-Type: application/json' -H 'X-Gotify-Key: $GOTIFY_TOKEN' -d "$payload" +curl -X "POST" "https://gotify.sysctl.io/message" -H "accept: application/json" -H "Content-Type: application/json" -H "X-Gotify-Key: $GOTIFY_TOKEN" -d "$payload" ''; in diff --git a/nixos/hosts/backups-rpi4/default.nix b/nixos/hosts/backups-rpi4/default.nix index 52e1e12e..2638bd38 100644 --- a/nixos/hosts/backups-rpi4/default.nix +++ b/nixos/hosts/backups-rpi4/default.nix @@ -23,6 +23,9 @@ libraspberrypi raspberrypi-eeprom ]; + + # Set your time zone. + time.timeZone = "Asia/Tokyo"; ##################################################################################### # BEGIN hardware config diff --git a/nixos/hosts/piaware-rpi4/default.nix b/nixos/hosts/piaware-rpi4/default.nix index 627c81c4..074828e6 100644 --- a/nixos/hosts/piaware-rpi4/default.nix +++ b/nixos/hosts/piaware-rpi4/default.nix @@ -23,6 +23,9 @@ raspberrypi-eeprom ]; + # Set your time zone. + time.timeZone = "Asia/Tokyo"; + ##################################################################################### # BEGIN hardware config #####################################################################################