Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'One way to avoid keeping DMG files after installation' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
One way to avoid keeping DMG files after installation
Authored by: krang on Jan 11, '08 01:43:47PM

Or you could use a crontab:

0 20 * * * /Path/To/Script/clean.sh

With something like the following:


if [ -d ~/Downloads/ -a -d ~/Downloads/archive/ ]; then

    find ~/Downloads/* ! -path '*archive*' -mtime +1 -maxdepth 0 -exec mv {} ~/Downloads/archive/ \;

    find ~/Downloads/archive/* -mtime +30 -maxdepth 0 -exec rm -rf {} \;

fi

This will move any files in the ~/Downloads/ folder, to a child folder called "archive" on a daily basis... then after 30 days, delete it.

Although, run at your own risk... its job is to actually delete data.



[ Reply to This | # ]