I routinely use bind mounts to aid in making space available in multiple locations without having to have multiple logical volumes / physical partitions / LUNs, etc.
For example, I may have a 200G LV mounted at /space
. From there, I will make subdirectories like var_opt
and var_log
which I can then bind mount to /var/opt
and /var/log
, respectively.
When doing a cleanup on the 'space' directory, is it possible to exclude directories from an rm -rf
running inside /space
?
Example:
# pwd
/space
# rm -rf * {except-for-var_opt-and-var_log}
Is there a different or better (but similarly simple) way to accomplish what I'm trying to do that I haven't thought of?