Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I believe if you don't use a slash at the end of the source directory, it will copy the _directory_, not just its contents.

    rsync code remote:/
I believe that results in remote:/code/app.js

    rsync code/ remote:/
I believe that results in remote:/app.js


Good explanation -- at the risk of mindlessly repeating you, my reason for the "always use trailing/ slashes/" suggestion is that the behaviour in that case has (for me at least) always been the scenario desired most often:

    rsync /some/where/local/ host:/another/place/remote/
The contents of local/ go into remote/




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: