Update starship and backup script

This commit is contained in:
albert 2025-01-08 17:30:35 +01:00
parent 634a500dc8
commit 9d818106d6
Signed by: albert
GPG key ID: 3895DD267CA11BA9
2 changed files with 5 additions and 5 deletions

View file

@ -52,7 +52,7 @@ in
hostname = { hostname = {
ssh_only = true; ssh_only = true;
style = "fg:${usernameFG} bg:${usernameBG}"; style = "fg:${usernameFG} bg:${usernameBG}";
format = "[@$hostname]($style)"; format = "[ $hostname ]($style)";
disabled = false; disabled = false;
}; };

View file

@ -259,11 +259,11 @@ cleanup_snapshots() {
log "Deleting remote snapshot: $snapshot" log "Deleting remote snapshot: $snapshot"
if ! ssh "$REMOTE_HOST" "btrfs subvolume delete '$BASE_DEST_PATH/$snapshot/snapshot'"; then if ! ssh "$REMOTE_HOST" "btrfs subvolume delete '$BASE_DEST_PATH/$snapshot/snapshot'"; then
send_notification "Backup Warning" "Failed to delete remote snapshot $snapshot on $HOSTNME" 6 send_notification "Backup Warning" "Failed to delete remote snapshot $snapshot on $HOSTNME" 6
log "WARNING: Failed to delete remote snapshot $snapshot" log "WARNING - Failed to delete remote snapshot $snapshot"
fi fi
if ! ssh "$REMOTE_HOST" "rm -rf '$BASE_DEST_PATH/$snapshot'"; then if ! ssh "$REMOTE_HOST" "rm -rf '$BASE_DEST_PATH/$snapshot'"; then
send_notification "Backup Warning" "Failed to cleanup remote snapshot directory $snapshot on $HOSTNME" 6 send_notification "Backup Warning" "Failed to cleanup remote snapshot directory $snapshot on $HOSTNME" 6
log "WARNING: Failed to cleanup remote snapshot directory $snapshot" log "WARNING - Failed to cleanup remote snapshot directory $snapshot"
fi fi
fi fi
@ -271,7 +271,7 @@ cleanup_snapshots() {
log "Deleting local snapshot: $snapshot" log "Deleting local snapshot: $snapshot"
if ! sudo snapper -c "$SNAPPER_CONFIG" delete "$snapshot"; then if ! sudo snapper -c "$SNAPPER_CONFIG" delete "$snapshot"; then
send_notification "Backup Warning" "Failed to delete local snapshot $snapshot on $HOSTNME" 6 send_notification "Backup Warning" "Failed to delete local snapshot $snapshot on $HOSTNME" 6
log "WARNING: Failed to delete local snapshot $snapshot" log "WARNING - Failed to delete local snapshot $snapshot"
fi fi
done done
fi fi
@ -350,7 +350,7 @@ fi
# Final verification # Final verification
if ! ssh "$REMOTE_HOST" "btrfs subvolume show '$DEST_PATH/snapshot'" &>/dev/null; then if ! ssh "$REMOTE_HOST" "btrfs subvolume show '$DEST_PATH/snapshot'" &>/dev/null; then
send_notification "Backup Failed" "Final verification failed for $SNAPPER_CONFIG on $HOSTNME" 8 send_notification "Backup Failed" "Final verification failed for $SNAPPER_CONFIG on $HOSTNME" 8
log "WARNING: Final verification failed" log "WARNING - Final verification failed"
exit 1 exit 1
fi fi