[英]Move files and directories older than specific time with the same folder structure
I want to move all files and directories are located on /etc/ that are older than 90 days to /old-etc directory but with the same structure in the source directory. 我想将所有超过90天的文件和目录都位于/ etc /上,移至/ old-etc目录,但源目录中的结构相同。
Thanks 谢谢
尝试这样做:
find /etc -mtime +90 -type f -exec bash -c 'install -D "$1" "/old-etc/$1" && rm -f "$1"' -- {} \;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.