Parcourir la source

sync before unmounting

subDesTagesMitExtraKaese il y a 2 mois
Parent
commit
ae9110dbc9
1 fichiers modifiés avec 1 ajouts et 0 suppressions
  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."