rsync how to send folder contents but not folder itself

Currently I have the following command which will send a folder and it's contents recursively:

rsync -avz --ignore-existing --recursive /var/-iles/_site :/var/www

What I want is only the contents of folder _site to be sent to folder www, not the _site folder itself.

Is it possible to send only the contents of folder _site via rsync?

Thanks

1 Answer

This can be done using shell globbing:

rsync -avz --ignore-existing --recursive /var/-iles/_site/* :/var/www/

All the contents of the /var/-iles/_site/ directory will be copied to the destination.

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like