I have a regular task that I need to swap out a live/accessed dir with a new version of it.
- There is a live dir with resources in it:
- Goal is to swap this out with
dir_new/and cause as little disruption in access to the dir.
- The content is live/accessed. Stopping access to the directory from end users is out of scope. I would just do this during a downtime window otherwise.
Here's how I do it now:
mv dir dir_old && mv dir_new dir
This works fine, but I'm not sure if any experts have a faster/more reliable way?
- The filesystem is
- The "new" dir cannot have ANY content from the existing dir in it, so moving in place, dealing with files didn't seem like it would work.
--deleteoption? However a requirement is to change "everything" at once in the dir. In other words I can't have a mix of files from the new and old mixed together.