Trying to move files beyond cutoff date in subfolders and retain directory structure
Linux - NewbieThis forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.