patate: relax mount by rsync-backup
authorSéverine Popek <severine.popek@autistici.org>
Mon, 22 Mar 2021 19:28:39 +0000 (20:28 +0100)
committerSéverine Popek <severine.popek@autistici.org>
Wed, 7 Apr 2021 01:54:41 +0000 (03:54 +0200)
hosts/patate/backup/rsync-backup.nix

index 9af1fc9ceae8cec3b5e81fa31fa4a7477f206b04..3e4b7e1b8b467aeb924d35772d3ab4f4cec2a248 100644 (file)
@@ -32,7 +32,10 @@ home-manager.users.sevy = {
         FS_LABEL=$1
         set -eux
         DEVICE=$(${pkgs.util-linux}/bin/blkid -l -o device -t LABEL="$FS_LABEL")
-        ${pkgs.glib}/bin/gio mount --device "$DEVICE"
+        while ! ${pkgs.glib}/bin/gio mount --device "$DEVICE"
+          do test ! -d /run/media/sevy/"$FS_LABEL" || break
+             sleep 1
+          done
         ${pkgs.rsync}/bin/rsync --verbose --itemize-changes \
           --partial --recursive --times \
           --compress-level=0 --delete --delete-before \