Sfoglia il codice sorgente

sync before unmounting

subDesTagesMitExtraKaese 2 mesi fa
parent
commit
ae9110dbc9
1 ha cambiato i file con 1 aggiunte e 0 eliminazioni
  1. 1 0
      unmount_hdd.sh

+ 1 - 0
unmount_hdd.sh

@@ -6,6 +6,7 @@ source .env
 # Execute unmount command on the server via SSH and capture output
 OUTPUT=$(ssh -i "$SSH_KEY" -p "$SSH_PORT" "$SERVER_USER@$SERVER_IP" << EOF
     # Try to unmount the HDD and handle errors
+    sudo /usr/bin/sync "$MOUNT_POINT"
     sudo /bin/umount "$MOUNT_POINT" $1
     if [ \$? -ne 0 ]; then
         echo "Failed to unmount HDD from $MOUNT_POINT."