Open zdenekgebauer opened 9 years ago
I use this hack to correct the permissions of uploaded files:
#!/bin/bash
FTPURL="ftp://user@host"
LCD="$(readlink -f "$(dirname "$0")")/public"
if [ "$(expr substr "$(uname -s)" 1 5)" == "MINGW" ]; then
LCD="/cygdrive$LCD"
fi
RCD="/"
lftp -c "set ftp:list-options -a;
set cmd:fail-exit yes;
open '$FTPURL';
lcd '$LCD';
cd '$RCD';
mirror --reverse --verbose --only-newer --ignore-time --no-perms" | python -c "import fileinput
import sys
import re
print(\"open '$FTPURL';\")
for l in fileinput.input():
print(l, file=sys.stderr, end='')
f = re.search(\"Transferring file \`(.+)'\", l)
d = re.search(\"Making directory \`(.+)'\", l)
if f:
print(\"Changing permissions of \`\" + f.group(1) + \"' to 644\", file=sys.stderr)
print(\"chmod 644 '\" + f.group(1).replace(\"'\", \"\\\\'\") + \"';\")
elif d:
print(\"Changing permissions of \`\" + d.group(1) + \"' to 755\", file=sys.stderr)
print(\"chmod 755 '\" + d.group(1).replace(\"'\", \"\\\\'\") + \"';\")" | lftp
Have you tried --no-perms option?
пн, 5 дек. 2016, 20:06 Jan Tojnar notifications@github.com:
I use this hack to correct the permissions of uploaded files:
!/bin/bash
FTPURL="ftp://user@host" LCD="$(readlink -f "$(dirname "$0")")/public"if [ "$(expr substr "$(uname -s)" 1 5)" == "MINGW" ]; then LCD="/cygdrive$LCD"fi RCD="/" lftp -c "set ftp:list-options -a;set cmd:fail-exit yes;open '$FTPURL';lcd '$LCD';cd '$RCD';mirror --reverse --verbose --only-newer --ignore-time" | python -c "import fileinputimport sysimport reprint(\"open '$FTPURL';\")for l in fileinput.input(): print(l, file=sys.stderr, end='') f = re.search(\"Transferring file `(.+)'\", l) d = re.search(\"Making directory `(.+)\'\", l) if f: print(\"Changing permissions of `\" + f.group(1) + \"' to 644\", file=sys.stderr) print(\"chmod 644 '\" + f.group(1) + \"';\") elif d: print(\"Changing permissions of `\" + d.group(1) + \"' to 755\", file=sys.stderr) print(\"chmod 755 '\" + d.group(1) + \"';\")" | lftp
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/lavv17/lftp/issues/119#issuecomment-264912750, or mute the thread https://github.com/notifications/unsubscribe-auth/AA67XE9jhPfEOfiNULJmTt3YrZG37JI6ks5rFESzgaJpZM4DTvis .
Yes. That seems to set 770 instead of 750. I need the others’ read permission to be enabled, though.
On 7 December 2016 at 04:20, Alexander V. Lukyanov <notifications@github.com
wrote:
Have you tried --no-perms option?
пн, 5 дек. 2016, 20:06 Jan Tojnar notifications@github.com:
I use this hack to correct the permissions of uploaded files:
!/bin/bash
FTPURL="ftp://user@host" LCD="$(readlink -f "$(dirname "$0")")/public"if [ "$(expr substr "$(uname -s)" 1 5)" == "MINGW" ]; then LCD="/cygdrive$LCD"fi RCD="/" lftp -c "set ftp:list-options -a;set cmd:fail-exit yes;open '$FTPURL';lcd '$LCD';cd '$RCD';mirror --reverse --verbose --only-newer --ignore-time" | python -c "import fileinputimport sysimport reprint(\"open '$FTPURL';\")for l in fileinput.input(): print(l, file=sys.stderr, end='') f = re.search(\"Transferring file `(.+)'\", l) d = re.search(\"Making directory `(.+)\'\", l) if f: print(\"Changing permissions of `\" + f.group(1) + \"' to 644\", file=sys.stderr) print(\"chmod 644 '\" + f.group(1) + \"';\") elif d: print(\"Changing permissions of `\" + d.group(1) + \"' to 755\", file=sys.stderr) print(\"chmod 755 '\" + d.group(1) + \"';\")" | lftp
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/lavv17/lftp/issues/119#issuecomment-264912750, or mute the thread https://github.com/notifications/unsubscribe-auth/ AA67XE9jhPfEOfiNULJmTt3YrZG37JI6ks5rFESzgaJpZM4DTvis .
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/lavv17/lftp/issues/119#issuecomment-265344724, or mute the thread https://github.com/notifications/unsubscribe-auth/AArCY9jvJ3qopnpc3SuRMpDIl6xFCvEoks5rFiX6gaJpZM4DTvis .
What happens if you do "site umask 022" before upload?
ср, 7 дек. 2016, 6:58 Jan Tojnar notifications@github.com:
Yes. That seems to set 770 instead of 750. I need the others’ read permission to be enabled, though.
On 7 December 2016 at 04:20, Alexander V. Lukyanov < notifications@github.com
wrote:
Have you tried --no-perms option?
пн, 5 дек. 2016, 20:06 Jan Tojnar notifications@github.com:
I use this hack to correct the permissions of uploaded files:
!/bin/bash
FTPURL="ftp://user@host" LCD="$(readlink -f "$(dirname "$0")")/public"if [ "$(expr substr "$(uname -s)" 1 5)" == "MINGW" ]; then LCD="/cygdrive$LCD"fi RCD="/" lftp -c "set ftp:list-options -a;set cmd:fail-exit yes;open '$FTPURL';lcd '$LCD';cd '$RCD';mirror --reverse --verbose --only-newer --ignore-time" | python -c "import fileinputimport sysimport reprint(\"open '$FTPURL';\")for l in fileinput.input(): print(l, file=sys.stderr, end='') f = re.search(\"Transferring file `(.+)'\", l) d = re.search(\"Making directory `(.+)\'\", l) if f: print(\"Changing permissions of `\" + f.group(1) + \"' to 644\", file=sys.stderr) print(\"chmod 644 '\" + f.group(1) + \"';\") elif d: print(\"Changing permissions of `\" + d.group(1) + \"' to 755\", file=sys.stderr) print(\"chmod 755 '\" + d.group(1) + \"';\")" | lftp
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/lavv17/lftp/issues/119#issuecomment-264912750, or mute the thread https://github.com/notifications/unsubscribe-auth/ AA67XE9jhPfEOfiNULJmTt3YrZG37JI6ks5rFESzgaJpZM4DTvis .
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/lavv17/lftp/issues/119#issuecomment-265344724, or mute the thread < https://github.com/notifications/unsubscribe-auth/AArCY9jvJ3qopnpc3SuRMpDIl6xFCvEoks5rFiX6gaJpZM4DTvis
.
— You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/lavv17/lftp/issues/119#issuecomment-265349360, or mute the thread https://github.com/notifications/unsubscribe-auth/AA67XCi3IYCC1Z6K-YlsjMmPRJOrmC9Tks5rFi72gaJpZM4DTvis .
set ftp:default-file-perm=0644 set ftp:default-folder-perm=0755
Are these options documented anywhere? They aren't here: https://lftp.yar.ru/lftp-man.html
There are no such settings in lftp.
I missing configuration of permissions for newly uploaded files and folders separately, because there is a problem to transfer permissions from windows to linux server . For example something like this:
set ftp:default-file-perm=0644 set ftp:default-folder-perm=0755 open ftp://user:password@site mirror -R quit