• # rsync chmod et setgid

    Posté par . En réponse au message chownage et chmodage d'un site web complet. Évalué à -9.

    rsync -avz --chmod=o-rwx -p toto/ toto2/

    And here is a full test :
    Create some file in a folder

    $ mkdir toto1
    $ mkdir toto2
    $ cd toto1
    $ touch tyoto
    $ touch tiuti

    The default perms are : u=rw, g=r, o=r

    $ ls -l
    total 0
    -rw-r--r-- 1 romain users 0 fév 16 11:48 tiuti
    -rw-r--r-- 1 romain users 0 fév 16 11:48 tyoto

    Try an rsync without params

    $ cd ..
    $ rsync -avz toto1/ toto2/

    The destination perms are the same than the source files

    $ ls -l toto2
    total 0
    -rw-r--r-- 1 romain users 0 fév 16 11:48 tiuti
    -rw-r--r-- 1 romain users 0 fév 16 11:48 tyoto

    Specify the rsync options --chmod=o-rwx -p

    $ rsync -avz --chmod=o-rwx -p toto1/ toto2/
    $ ls -l toto2
    total 0
    -rw-r----- 1 romain users 0 fév 16 11:48 tiuti
    -rw-r----- 1 romain users 0 fév 16 11:48 tyoto

    avec le setgid
    --chmod Dg+s