bash

Recursively Rsync/copy files to different structure  #angularjs #reactjs

  • And copying the resources directory directly into the sites directory.
  • Basically copying the contents of the public directory in each site up one directory, and then syncing that parent directory to the public directory.
  • for site in $MY_PATH/dev/*; do dist=”$MY_PATH/public/$(basename “$site”)” mkdir -p “$dist” rsync -r –exclude=’.
  • The first rsync command of this script works fine, it copies the files into the sites directory without issue, since the folder structure does not need to change.
  • I’m not really sure how to easily copy the files recursively into the proper site folder, while also moving the destination files out of their public dir, and up one directory so they live directly under the sitename.

I want to sync all of the files inside the public directory of each site folder in the dev directory, into the public directory above like so:

@ng_real_ninja: Recursively Rsync/copy files to different structure #angularjs #reactjs

I have the given file structure:

directory above like so:

directory into the sites folder like so:

directory. And copying the resources directory directly into the sites directory. I have this second part working, but the first part isn’t working right:

This is what I have:

The first rsync command of this script works fine, it copies the files into the sites directory without issue, since the folder structure does not need to change. However, the second rsync command does the following:

I’m not really sure how to easily copy the files recursively into the proper site folder, while also moving the destination files out of their public dir, and up one directory so they live directly under the sitename.

Any ideas?

bash