Я выполнил команду
sudo rsync --chmod=a+rwx testfile testfile2
Это создает файл testfile2 но разрешения для него 755 (-rwxr-xr-x)
Может кто-нибудь объяснить, как сделать так, чтобы разрешения были 777 (-rwxrwxrwx)?
Я выполнил команду
sudo rsync --chmod=a+rwx testfile testfile2
Это создает файл testfile2 но разрешения для него 755 (-rwxr-xr-x)
Может кто-нибудь объяснить, как сделать так, чтобы разрешения были 777 (-rwxrwxrwx)?
использование
sudo rsync --perms --chmod=777 testfile testfile2
или же
sudo rsync --perms --chmod=a+rwx testfile testfile2
Использование --chmod = 777 с rsync может дать сбой:
sudo rsync --perms --chmod=777 ./testfile ./testfile2
rsync: Invalid argument passed to --chmod (777) 
rsync error: syntax or usage error (code 1) at main.c(1453) [client=3.0.9]
Тем не менее, они успешны:
sudo rsync --perms --chmod=u+rwx ./testfile ./testfile2
sudo rsync --perms --chmod=g+rwx ./testfile ./testfile2
sudo rsync --perms --chmod=o+rwx ./testfile ./testfile2
т.е. добавить (+) разрешения для пользователя (u), группы (g) или других (o) соответственно.
Также (а)= все успешно:
sudo rsync --perms --chmod=a+rwx ./testfile ./testfile2
или альтернативно:
sudo rsync --perms --chmod=ugo+rwx ./testfile ./testfile2
Это --perms может быть заменено на -p с такими же результатами.
Отзыв (-) разрешений работает так же, и даже комбинации добавления и отзыва через запятую:
sudo rsync --perms --chmod=u-rwx,o+rwx ./testfile ./testfile2