Search code examples
linuxdeploymentweb-deploymentrsync

rsync exclude folder contents but still create folder


I have my application:

folder1
folder2
cache
     something_cached1
     something_cached2

now I want to rsync my project to the server

BUT

if I do

 --exclude=cache

the folder won't be existing in the server so, I will get an error from the application as it tries to write to a non existent location


Solution

  • quite simple I see, just add:

    --exclude 'cache/*'