I'm beginning to have second thoughts about the script as it works now. I'm wondering how this one stands up instead:
Code:
#! /bin/sh
cd $HOME/Desktop/Trash/
rm -ri .countdown/*
find -not -name .directory -not -name . -not -name .countdown -maxdepth 1 -exec mv -i {} .countdown \;
exit 0
(No, I didn't get the two lines switched. The second command moves the files, an hour passes, then the first line removes them.)
Would it be better to move all files to a specific directory, then delete them, or would it be better to go by the access date?
Some points:
It needs to act on both files and dirs.
However, only the files/dirs in the root directory of the Trash need to be looked at.
I'll think about adding a read-only/working switch later. Right now, it's staying in confirmation mode.
I need a bit more help on the output files. I tried
Code:
#! /bin/sh
cd $HOME/Desktop/Trash/
rm -ri .countdown/* > t_log.txt
find -not -name .directory -not -name . -not -name .countdown -maxdepth 1 -exec mv -i {} .countdown \; >> t_log.txt
exit 0
but that just produces a blank file. Is this working the way it should? Is there a way to record the files being moved or deleted?
Thanks for all your help.