RE: achive and remove old files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



LOL, Paul, you are in late for 11 minutes after me ;-)
Patrick


"Pettit, Paul" <ismanager@xxxxxxxxxxx> wrote:
Steve gave you a good example of how to remove the files. Try this to
"archive" them the same way:

find //\( -type f -a -mtime +730 \) -exec mv
--target-directory=/// {} \;

When doing the above be sure to have the archive dir in a different tree
than the source. If you try to archive the old files into a dir that is
in the source dir you will get "existing file" errors because it will
desend down your archive dir and try to move those files too. Also note
that moving the files will change their accessed timestamp (but not the
modified timestamp). I'm not sure the trailing slash in
'--targe-directory=' is needed but if your moving dirctories as well as
files it won't hurt and is probably prudent.

Paul Pettit
CCB Inc.


-----Original Message-----
From: redhat-list-bounces@xxxxxxxxxx
[mailto:redhat-list-bounces@xxxxxxxxxx] On Behalf Of Jianping Zhu
Sent: Wednesday, January 05, 2005 9:37 AM
To: redhat-list@xxxxxxxxxx
Subject: achive and remove old files 


S redhat 9.0
I have a huge direcory (more than 30 GB) I want to take all the files
and sub-dirctries which have not been modified or used for more than
two year out of the diretory and achive it then delete them them from
the original direcoty. Does anyone have a script to do this kind of
work?
Thank


-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

		
---------------------------------
 Découvrez le nouveau Yahoo! Mail : 250 Mo d'espace de stockage pour vos mails !
Créez votre Yahoo! Mail
-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux