How can I compress all the directories that do not contain at least one file used in the last month?
feedback
|
migrated from stackoverflow.com Dec 11 '11 at 12:59
This question came from our site for professional and enthusiast programmers.
|
You need a two-step approach. But why do you really want to do this in shell? It will be a lot faster when you actually implement this directly, say with a python script. The reason is that you can stop scanning a directory if you have found a "recent" file (except for subdirectories that you might still want to archive). The naive shell-based approach would be to find all folders, then rescan each folder for the recent files. Something like this (for
But again, note that this is not very efficient, and will also contain redundant entries (if a directory is "unused", it will also list all subdirs.) | |||||||||
feedback
|
