.png)
서버에 클라이언트 폴더 세트가 있습니다. 각 클라이언트는 다음과 같이 "백업" 디렉토리 내에 백업을 가지고 있습니다.
~/backups/<CLIENT_NAME>/{daily, weekly, monthly}/{databases, directories, logs}
모든 클라이언트 폴더를 검색하여 특정 시간보다 오래된 파일을 제거하는 방법을 찾고 싶습니다. find
각 클라이언트에 대해 작업을 수행하지 않고도 이 작업을 수행할 수 있습니까 ? 지금까지 각 클라이언트에 대해 3개의 작업을 수행해야 하며 find
수십 개가 있습니다.
find ~/backups/<CLIENT_NAME>/daily/{directories,databases,logs} -mtime +6 -exec rm -rf {} \;
find ~/backups/<CLIENT_NAME>/weekly/{directories,databases,logs} -mtime +27 -exec rm -rf {} \;
find ~/backups/<CLIENT_NAME>/monthly/{directories,databases,logs} -mtime +31 -exec rm -rf {} \;