File permission issue


Skrumpy

Recommended Posts

I have a fairly simple Userscript script (below) running that lftps files from a remote server then updates permissions so that Sonarr/Radarr can move them. Everything was working well until an update or so ago. Did something change that would prevent this from working? I now have to run docker safe new perms because files come in as root -rw-r--r-- instead of nobody -rw-rw-rw- and sit on the cache drive until it runs out of space and seizes Unraid. Feels like I'm missing something simple here..

 

 

#!/bin/bash
LOGIN="login"
HOST="xxx.xxx.xxx.xx"
LOCAL_DIR="/mnt/cache/data/downloads"
REMOTE_DIR="/home/deluge/sync/"
NFIL=1
NSEG=5

lf=/tmp/syncfiles.lck
	touch $lf
	read lastPID < $lf
		[ ! -z "$lastPID" -a -d /proc/$lastPID ] && exit
	echo $$ > $lf

lftp -u "$LOGIN",placeholder -e "set sftp:connect-program 'ssh -a -x -i /root/.ssh/Key'" sftp://"$HOST":22<< EOF
	set xfer:use-temp-file true
	set xfer:temp-file-name *.tmp
	# set pget:min-chunk-size ${MINCHUNK}
	set pget:default-n ${NSEG}
	set mirror:use-pget-n ${NSEG}
	set mirror:parallel-transfer-count ${NFIL}
	set mirror:parallel-directories true
	set mirror:no-empty-dirs true
	set net:max-retries 2
	mirror -c --Move --only-missing --no-perms --no-umask "${REMOTE_DIR}" "${LOCAL_DIR}"
	quit
EOF

chmod -R 0777 $LOCAL_DIR

exit

 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.