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


Click here to return to the 'Avoid a cluttered download folder by using /tmp' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Avoid a cluttered download folder by using /tmp
Authored by: patpro on Jan 08, '14 06:40:54AM

If I'm not mistaken, daily /tmp cleanup is handled by periodic(5), through the execution of periodic script /etc/periodic/daily/110.clean-tmps.

periodic(5) is a fully configurable system. It allows you to tweak settings available in /etc/defaults/periodic.conf. You just have to create an empty /etc/periodic.conf file, and add your custom settings, like for example:

daily_clean_tmps_dirs="/tmp /Users/foo/Downloads"

Quite simple, indeed, but require proper testing (I'm using this on FreeBSD, mainly).

---
http://www.patpro.net/



[ Reply to This | # ]
Avoid a cluttered download folder by using /tmp
Authored by: Strod on Jan 08, '14 07:07:36AM
Furthermore, you can create a shell script in /etc/daily.local to execute whatever crazy maintenance task you want performed every day. Same goes for weekly and monthly tasks.

[ Reply to This | # ]
Avoid a cluttered download folder by using /tmp
Authored by: comodin on Jan 08, '14 11:54:39AM

i use this file: /private/etc/periodic/daily/111.clean-download

#!/bin/sh

# If there is a global system configuration file, suck it in.
#
if [ -r /etc/defaults/periodic.conf ]
then
. /etc/defaults/periodic.conf
source_periodic_confs
fi

if [ -d /Users/foo/Downloads ]; then
echo ""
echo "Removing old download files"
cd /Users/foo/Downloads && \
find . -type f -mtime +7 -delete >/dev/null 2>&1;
fi

---
--



[ Reply to This | # ]