docker-rclone icon indicating copy to clipboard operation
docker-rclone copied to clipboard

Can't follow symlink without -L/--copy-links

Open deejayexe opened this issue 3 years ago • 0 comments

@JmzTaylor @pfidr34 , it took some fiddling and understanding of how docker handles symlinks for volumes but I was able to get this working by using the --copy-links flag in SYNC_OPTS.

The important part is that the symlinks are relative path links so they can be interpreted inside the container.

Example:

ln -s /mnt/SSD_STRGE/TEMP/D /mnt/SSD_STRGE/TEMP/E

This will fail in the container because the reference for folder E is /mnt/SSD_STRGE/TEMP/D however the path /mnt/SSD_STRGE/TEMP does not exist in the container.

This however will work inside the container:

cd /mnt/SSD_STRGE/TEMP
ln -s ./D ./E 

See docker-copose:

rclone_test:
    image: "rclone_test"
    container_name: "rclone_test"
    volumes:
      - ${USERDIR}/docker/rclone_test:/config
      - ${USERDIR}/docker/rclone_test/logs:/logs
      - /mnt/SSD_STRGE/TEMP:/mnt/TEMP
    environment:
      - UID=1000
      - GID=1000
      - CRON=@daily
      - RCLONE_CMD=copy
      - SYNC_DEST=GDrive:/1
      - SYNC_SRC=/mnt/TEMP
      - SYNC_OPTS=--copy-links -v
      - RCLONE_DIR_CMD=lsf
      - OUTPUT_LOG=1
      - FORCE_SYNC=1
      - TZ=${TZ}

Originally posted by @pfidr34 in https://github.com/pfidr34/docker-rclone/issues/14#issuecomment-629869805

I issue this old post because when start docker pfidr/rclone i can´t Can't follow symlink in a directory, this is my docker config: docker run -d
--name=rclone-copy_media_cloud
--restart always
-v /share/rclone-copy/config/:/config
-v /share/media/media_cloud/:/source
-e RCLONE_CMD="copy"
-e SYNC_SRC="/source"
-e SYNC_DEST="crypt:cloud"
-e SYNC_OPTS="--log-level INFO --checksum --transfers 4 --checkers 8 --bwlimit 45M --contimeout 60s --timeout 300s --retries 3 --low-level-retries 10 --stats-file-name-length 0 --fast-list --stats 60s --copy-links --drive-stop-on-upload-limit --links"
pfidr/rclone

This is the log inside -v /share/media/media_cloud/:/source \ i can´t copy symlink directory in media_cloud directory 2022/01/10 18:59:53 NOTICE: Tv_Cloud: Can't follow symlink without -L/--copy-links 2022/01/10 18:59:53 NOTICE: Film_4K_Cloud: Can't follow symlink without -L/--copy-links 2022/01/10 18:59:53 NOTICE: Film_Cloud: Can't follow symlink without -L/--copy-links

But i use manually rclone browser with similar sync opts and i havent problem in same directory: /media/rclonebrowser --config /share/rclone-copy/config/rclone.conf copy --checksum --verbose --transfers 2 --checkers 8 --contimeout 60s --timeout 300s --retries 3 --low-level-retries 10 --stats-file-name-length 0 --fast-list --stats 60s --copy-links --drive-stop-on-upload-limit /share/media/media_cloud/ crypt:cloud/

¿ Can u explain how i can copy with --copy-links ? i dont understand ur explanation.

Thanks

deejayexe avatar Jan 10 '22 18:01 deejayexe