[TriLUG] `find -delete` not deleting
Joseph Mack NA3T via TriLUG
trilug at trilug.org
Tue Sep 6 14:31:59 EDT 2016
On Tue, 6 Sep 2016, Aaron Morrison via TriLUG wrote:
>> Why are you using find? Your directories are already named for
>> datestamps. Just have the cron job's shellscript calculate 7 days
>> ago (let's say 8/27/2016), then do rm -rf whatever/20160827.
> So what if cron misses its trigger? E.g. On a laptop that is off or sleeping?
This is it. It had to be an "older than" type instruction. You can't depend on a
machine being up and running and everthing working all the time.
> Alan P said
> lastweek=$(date -d "-7 days" +%y%m%d)
I notice that Alan uses these sort of date constructions all the time, but I
find the documentation for the arguments to `date` hard to understand. I have to
go find an example in my files somewhere, but they are few and far between. It's
easier if I can find something else.
Joe
--
Joseph Mack NA3T EME(B,D), FM05lw North Carolina
jmack (at) austintek (dot) com - azimuthal equidistant
map generator at http://www.wm7d.net/azproj.shtml
Homepage http://www.austintek.com/ It's GNU/Linux!
More information about the TriLUG
mailing list