recursive

Copying with rsync

rsync --progress --recursive source target
To resume a previously interrupted copy:
rsync --progress --recursive --ignore-existing source target

 
Please note that rsync source/ target and rsync source target do produce different results!

The trailing slash at the end of the source directory causes rsync to copy the contents of the source directory into the target directory. Without the trailing slash, the target directory will contain one directory that is identical to the source directory.

File permissions on html server (recursive chmod) differentiating between files and directories

I recursively screwed up the file permissions in my html servers root directory. To fix it I needed to deploy some "advanced" chmod settings. Obviously I want to treat directories and files differently. I didn't come up with a better solution than the following:

chmod -R u=rw-x,g=rw-x,o=r-wx *
chmod -R a+X *

Pages