|
Trying to move files beyond cutoff date in subfolders and retain directory structure
Hello,
my logs from various forms of chat (IRC, MSN, ICQ, various) are now beginning to grow excessively in size. I decided that I wanted to move all files older than 7 days to an external storage device, and figured after a while that I probably wanted to use ls with a sort-by-time order and pipe this to mv to move the files, however, I'm coming up against two problems. First, I don't see how to get any sort of "cutoff" in ls when I sort by time; Second, I want the moved files to retain their directory structure (it's sorted by program and then by server and then by user) when I move them. So it may be that I want to use mv directly in some way; I'm not sure.
My clunky fallback is to move the entire superfolder containing all the logs and let it re-establish itself over time - this will be annoying in the first few days, where I can't easily view what I was talking to a person about last time, but that's a minor nuisance, so this isn't a particularly important problem.
Thanks in advance for any help,
Erik Mesoy.
|