rclone with web GUI - all downloads go to /storage/var/media/... instead of /var/media/...

  • LibreELEC on Raspberry Pi 3 Model B. External HDD is connected via USB.

    I installed rclone to download files from my server over SFTP. And that works just fine, for example this command:

    Code
    # rclone copy myserver:/some/path/video.mkv /var/media/mydisk/downloads/

    ...successfully downloads video.mkv to /var/media/mydisk/downloads/, so it is saved to my external HDD.

    As the next step I ran rclone with its web-based GUI and connected to it from browser on my PC. Using its explorer I can successfully browse my external HDD (/var/media/mydisk/). But downloading a file from remote server behaves weirdly: the download itself goes just fine, but instead of /var/media/mydisk/downloads/ the file is saved to /storage/var/media/mydisk/downloads/, so it looks like rclone "thinks" that / "resolves" to /storage/.

    Do you think it can be "fixed" somehow in the system (as I guess it is caused by non-standard folders structure in LibreELEC), or does it look more like a bug in rclone's web GUI?

  • LE avoids to store temporary files on microSD card to maximize the lifetime of the card. That's why /var will be mounted in RAM space, so it's the wrong place for permanent storage, but temporary mount points will be there.

    If rclone let you browse the HDD, but doesn't store files in it, then rclone has the issue.

    You can create a link to fix it:

    rm -rf /storage/var/media/mydisk

    ln -s /var/media/mydisk /storage/var/media/mydisk

    Edited once, last by Da Flex (November 5, 2019 at 11:15 PM).

  • Unfortunately, that didn't work, but it helped me to realize that rclone doesn't respect symlinks by default. And after reading its documentation a bit I found a solution - to create a config section for local disk with this option provided and then use disk:/var/media/mydisk instead of /var/media/mydisk, and then it will use the right path to external disk.

    If anyone else would need it - /storage/.config/rclone/rclone.conf:

    Code
    [disk]
    type = local
    copy_links = true

    Actually, copy_links = true is an overkill here, but should help in case of ln -s /var/media/mydisk /storage/var/media/mydisk.