How to set file/folder permissions using Rsync from Windows to Linux

44

Solution 1

You can set the perms using the --chmod parameter e.g.

--chmod=Du=rwx,Dgo=rx,Fu=rw,Fog=r 

will force the permissions to be set to 755 for Directories and 644 for Files.

Solution 2

The --chmod argument syntax mentioned in the above is not quite accurate. When you specify owner, group, or other, and don't precede it with a "D" or a "F", it will apply that to all types of files, and it will apply the last parameter it finds as the default. This would explain why your directories were coming out as 744, since the last parameter in the argument was og=r.

Try this instead:

--chmod=Du=rwx,Dgo=rx,Fu=rw,Fgo=r
Share:
44

Related videos on Youtube

Unknownymous
Author by

Unknownymous

Updated on September 17, 2022

Comments

  • Unknownymous
    Unknownymous over 1 year

    I'm having a hard time to accomplished this: CODEPEN LINK

    As you can see in my CODEPEN sample. As you hover the image it shows the IMAGE CAPTION then if you clicked the image it will show the ACTIVATED IMAGE(RED BORDERS). My problem is how can I show the CAPTION when that image is ACTIVATED. I use JQUERY on clicking the image to show the RED BORDERS when activated.

    UPDATE: What I'm trying to do is when its activated it also show the CAPTION onclick just like the RED BORDERS.

    Your help is so much appreciated.

    • BillThor
      BillThor about 13 years
      Try umask 022 before your copy.
    • Mohammad Kermani
      Mohammad Kermani about 10 years
      you can do this: when your click function runs add a class to caption that class say the caption "display:block"
  • eatyourpeas
    eatyourpeas about 13 years
    Thanks. The folder seems change to 744(drwxr--r--). Anyway, I decide to change the permission after transfer.
  • Fred Wuerges
    Fred Wuerges about 10 years
    The --chmod also accepts octal mode numbers, which in my opinion is easier to visualize the permission given: --chmod=D2775,F664
  • Unknownymous
    Unknownymous about 10 years
    Thanks! that's what I'm expecting for.
  • hachre
    hachre about 6 years
    You can also use --chmod o=rX in order to automatically give folders the x flag, but omit it from files.
  • OrangeDog
    OrangeDog over 5 years
    Do you need to specify --perms as well?