title: How to recurse directory tree to operate on lower most directories first and highest directories last?
body: <p>I am needing to write a script that will move files to a destination location (off volume), remove the original file and directories and then move them back to their original location while preserving all attributes.</p>
  
  <p>The concept is rather simple algorithmically, however the real hangup I'm having is recursing the tree properly when I'm using rsync.</p>
  
  <p>So far it appears that <code>rsync -axvvES --remove-source-files source_directory /destination/</code> is the most efficient solution for copying files over, however, as noted, I cannot simply allow rsync to recurse the tree itself due to size constraints.  Ultimately I think <code>find</code> can be used to drill down and then allow <code>rsync</code> to run, however <strong>how can I descend to the lowest point first with <code>find</code> in order to accomplish this goal?</strong></p>
  
  <p>UPDATE:</p>
  
  <p>Ultimately this seemed to do the trick satisfactorily:</p>
  
  <pre><code>echo -e "Moving over... "
  rsync -axvES --remove-source-files ${SRC_FILE_AND_PATH} ${DESTINATION_PATH}/
  echo -e "Bringing back... "
  rsync -axvES --remove-source-files ${DESTINATION_PATH}/${SRC_BASENAME} ./
  </code></pre>
  
  <p>It does leave folders in the working directory, but since it does overwrite attributes correctly on the initial folder on the move back, it's satisfactory and in the end I can just rm the empty remaining directories.</p>