# rclone FUSE mount for the Open-Meteo (ERA5) archive bucket.
#
# Before installing:
#   - Replace BUCKET_NAME below with the object-storage bucket name.
#   - `--allow-other` requires `user_allow_other` to be set in /etc/fuse.conf.
#   - The `om-archive` remote must exist in /etc/rclone/rclone.conf (S3 remote).
#
# Install:
#   sudo install -m0644 rclone-mount.service.example /etc/systemd/system/rclone-om.service
#   sudo systemctl daemon-reload
#   sudo systemctl enable --now rclone-om

[Unit]
Description=rclone mount for Open-Meteo ERA5 archive
After=network-online.target
Wants=network-online.target

[Service]
Type=notify
ExecStartPre=/bin/mkdir -p /mnt/om-archive
ExecStart=/usr/bin/rclone mount om-archive:BUCKET_NAME /mnt/om-archive \
  --config /etc/rclone/rclone.conf \
  --vfs-cache-mode full \
  --vfs-cache-max-size 80G \
  --dir-cache-time 12h \
  --allow-other \
  --umask 000
ExecStop=/bin/fusermount -u /mnt/om-archive
Restart=on-failure

[Install]
WantedBy=multi-user.target
