rsync exclude folder contents but still create folder

1.1k views Asked by At

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

1

There are 1 answers

0
Tzook Bar Noy On BEST ANSWER

quite simple I see, just add:

--exclude 'cache/*'