Re: Date scripting

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

 



I do something like this:

#########################
#!/bin/bash
DAYSTOKEEP=30
COMMAND="rm -f"
BASEDIR=/directory/path/
FIND="/usr/bin/find"
$FIND $BASEDIR -mtime +$DAYSTOKEEP -exec $COMMAND {}
\;
##########################

This will find all files with a modification time of
more than 30 days ago and perform a "rm -f" on them. 
It will recurse further down the tree.  If you want it
also to remove directories make it "rm -rf".

Tom


-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list

[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux