Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7852903
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T19:31:55+00:00 2026-06-02T19:31:55+00:00

I am needing to write a script that will move files to a destination

  • 0

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.

The concept is rather simple algorithmically, however the real hangup I’m having is recursing the tree properly when I’m using rsync.

So far it appears that rsync -axvvES --remove-source-files source_directory /destination/ 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 find can be used to drill down and then allow rsync to run, however how can I descend to the lowest point first with find in order to accomplish this goal?

UPDATE:

Ultimately this seemed to do the trick satisfactorily:

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} ./

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T19:31:56+00:00Added an answer on June 2, 2026 at 7:31 pm

    The find command has a -depth switch which makes it behave like you ask for.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm needing to write a program (C#) that will allow the user to create
I am needing to write portable code that will run on a shared server
I'm needing to create a zip file containing documents that exist on the server.
I have a calendar script that uses a database - I am needing it
I am needing to write some code that I can compile and run on
I'm finding that with asynchronous callbacks I'm needing to write a try/catch for each
I'm needing to capture write operations (any query that changes data) but only for
I am needing to write an application that determines the value that comes up
I will be needing to write some pretty comprehensive documentation for an upcoming project
I intend to write an application where I will be needing to calculate the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.