Why is my rsync doing that? It’s basically just making a copy of the someDir folder inside otherDir. If I run the command again after making changes in /path/to/someDir, rsync will sync all files from /path/to/someDir to /path/to/otherDir/someDir. How do I get all the files inside /path/to/someDir synced to /path/to/otherDir.
This is what the command looks like that I’m excuting:
rsync --stats --compress --recursive --times --perms --links --delete --exclude ".git" --exclude "wp-content/upload" --exclude "wp-content/uploads" --exclude "wp-content/gallery" /path/to/someDir /path/to/otherDir
rsync is one of the few commands that make a distinction between
/your/pathand/your/path/When you don’t use the trailing backslash you are referring to the directory, while when you use it you are referring to the contents of the directory.
Try
That extra trailing slash in
/path/to/someDir/will make the contents of it available in/path/to/otherDir.BTW: Don’t be tempted to use
/path/to/someDir/*as was suggested, that will give you problems when you have many files and it won’t copy files with names beginning with..