#!/bin/sh

#로그 보기구문 sh /volume1/media/mount.sh >> /somewhere/you/can/easy/acces/MountScript.log 2>&1
# --log-file=/volume1/pvr/rclone.log>>/volume1/pvr/rclone.log &

# 콘솔에서는 PATH가 잡혀있어서 마운트가 문제없지만,
# 스케줄러에서 실행시 
# fusermount 에러가 발생한다. 스케줄러가 인지하는 fusermount PATH경로가 잡혀있지 않은듯하다.
# Fatal error: failed to mount FUSE fs: fusermount: exec: “fusermount”: executable file not found in $PATH
# 스크립트안에서 먼저 PATH를 선언해준다.
# export PATH=$PATH:/usr/syno/bin/fuse

export PATH=$PATH:/usr/syno/bin/fuse

rclone mount --config /root/.config/rclone/rclone.conf --umask 0 --allow-other --allow-non-empty --read-only remote:/TV /volume1/Gdrive/TV &
rclone mount --config /root/.config/rclone/rclone.conf --umask 0 --allow-other --allow-non-empty --read-only remote:/Ani /volume1/Gdrive/Ani &
rclone mount --config /root/.config/rclone/rclone.conf --umask 0 --allow-other --allow-non-empty --read-only remote:/movie1 /volume1/Gdrive/movie1 &
rclone mount --config /root/.config/rclone/rclone.conf --umask 0 --allow-other --allow-non-empty --read-only remote:/movie2 /volume1/Gdrive/movie2 &


#rclone mount remote:/TV /volume1/Gdrive/TV -v --no-modtime --retries 40 --allow-other &

