Mount SIF as a virtual drive
Short note on how to mount a SIF collection as a virtual drive on a UNIX-like operation system (Linux, macOS).
First log into SIF at https://sif.au.dk.
The run the below script:
$ sif_mount <coll-name>
where <coll-name> is the SIF collection name.
You can now access your SIF files locally.
BTW: I need a clean way to unmount instead of ps aux|grep rclone; kill <pid> or killall rclone.
#!/bin/zsh
# Usage: sif_mount
# Mounts the specified rclone remote "sif_" to ~/sif.
# --- Check argument ---
if [ -z "$1" ]; then
echo "Usage: $0 "
echo "Example: $0 mydata"
exit 1
fi
SIF_MOUNT=${HOME}/sif
if [ ! -d $SIF_MOUNT ]; then
echo "SIF mount $SIF_MOUNT not found."
exit 1;
fi
rclone mount sif_$1: $SIF_MOUNT \
--vfs-cache-mode writes \
--vfs-cache-max-age 2m \
--dir-cache-time 10s > ~/rclone.log 2>&1 &
sleep 3
echo "SIF collection $1 mounted at $SIF_MOUNT and log messeges in ~/rclone.log"