Daily Script on Mac OS X Server did not clean up /tmp
Wed, Oct 31 2012, 18:27 Apple, Mac OS X, server, Unix PermalinkLately my /tmp folder was piling up with files (krb5cc*) without any signals that these files were regularly deleted. A bit of googling showed that these come from the Open Directory Server, but that's something I cannot control. So I went to investigate why the daily script would not delete them. I googled a bit again and found out where the parameter file for the daily, weekly and monthly cleanup-scripts is located: /etc/defaults/periodic.conf. There, I found these settings for /tmp :
# 110.clean-tmps
daily_clean_tmps_enable="YES" # Delete stuff daily
daily_clean_tmps_dirs="/tmp" # Delete under here
daily_clean_tmps_days="3" # If not accessed for
daily_clean_tmps_ignore=".X*-lock .X11-unix .ICE-unix .font-unix .XIM-unix"
daily_clean_tmps_ignore="$daily_clean_tmps_ignore quota.user quota.group"
# Don't delete these
daily_clean_tmps_verbose="YES" # Mention files deleted
The one to look for is where it says "3". This indicates that the routine should clean up old files not accessed for 3 days. But it did not - and the files were not mentioned in the ignore-parameters. Even rm -rf krb5cc* returned immediately an error that its argument list was too long. Therefore I started reading what the exact values for this parameter should be.
Well, it turns out that the value needs a qualification, like d(ays) or m(months), etc.. I found that out by reading /etc/periodic/daily/110.clean-tmps and studying how find uses -atime, -ctime and -mtime and how to add or subtract values. Here are a few find-commands, copied from /etc/periodic/daily/110.clean-tmps, which I tried to make sure that what I just read was right:
$ cd /tmp
$ sudo find -dx . -fstype local -type f -atime +1h -mtime +1h -ctime +1h
$ sudo find -dx . -fstype local -type f -atime +1d -mtime +1d -ctime +1d
$ sudo find -dx . -fstype local -type f -atime +2d -mtime +2d -ctime +2d
Further reading suggested to use override-files, so I sudo'd into vi to create the file /etc/periodic.conf with the following contents:
daily_clean_tmps_days="2d"
Yes, 2 days. Three days is too long for a server, in my opinion. The file's attributes look like this:
marcvos @ ~ $ ls -l /etc/periodic.conf
-rw-r--r-- 1 root wheel 27 Oct 25 16:38 /etc/periodic.conf
Next, delete the file daily.out:
$ sudo rm /var/log/daily.out
Reboot the server. Check your /tmp folder and /var/log/daily.out the next days.
With me, I now finally saw all those files getting deleted.
# 110.clean-tmps
daily_clean_tmps_enable="YES" # Delete stuff daily
daily_clean_tmps_dirs="/tmp" # Delete under here
daily_clean_tmps_days="3" # If not accessed for
daily_clean_tmps_ignore=".X*-lock .X11-unix .ICE-unix .font-unix .XIM-unix"
daily_clean_tmps_ignore="$daily_clean_tmps_ignore quota.user quota.group"
# Don't delete these
daily_clean_tmps_verbose="YES" # Mention files deleted
The one to look for is where it says "3". This indicates that the routine should clean up old files not accessed for 3 days. But it did not - and the files were not mentioned in the ignore-parameters. Even rm -rf krb5cc* returned immediately an error that its argument list was too long. Therefore I started reading what the exact values for this parameter should be.
Well, it turns out that the value needs a qualification, like d(ays) or m(months), etc.. I found that out by reading /etc/periodic/daily/110.clean-tmps and studying how find uses -atime, -ctime and -mtime and how to add or subtract values. Here are a few find-commands, copied from /etc/periodic/daily/110.clean-tmps, which I tried to make sure that what I just read was right:
$ cd /tmp
$ sudo find -dx . -fstype local -type f -atime +1h -mtime +1h -ctime +1h
$ sudo find -dx . -fstype local -type f -atime +1d -mtime +1d -ctime +1d
$ sudo find -dx . -fstype local -type f -atime +2d -mtime +2d -ctime +2d
Further reading suggested to use override-files, so I sudo'd into vi to create the file /etc/periodic.conf with the following contents:
daily_clean_tmps_days="2d"
Yes, 2 days. Three days is too long for a server, in my opinion. The file's attributes look like this:
marcvos @ ~ $ ls -l /etc/periodic.conf
-rw-r--r-- 1 root wheel 27 Oct 25 16:38 /etc/periodic.conf
Next, delete the file daily.out:
$ sudo rm /var/log/daily.out
Reboot the server. Check your /tmp folder and /var/log/daily.out the next days.
With me, I now finally saw all those files getting deleted.
Comments
Foto: Fossiele Vissenkop?
Sat, Oct 20 2012, 21:36 Algemeen, History, Photo, Vacation PermalinkFossile Fish
We gingen fossielen zoeken bij Cadzand-Bad en eindigden uiteindelijk bij Het Zwind. Daar hebben we een middag lopen speuren en daarbij vond ik o.a. deze versteende vissenkop. De bek en het oog zitten ook aan de andere kant, maar of het inderdaad een vissenkop is.....?
We went looking for fossils at Cadzand-Bad but ended up at Het Zwind. There we have spent the afternoon hunting for fossils and then I found, a.o., this fossilized fish head. The beak and eye are also visible on the other side, but if it actually is a fish head....?
Multihouse Reünie in Grand Hotel ter Duin, Burgh-Haamstede
Fri, Oct 12 2012, 16:42 Event, Hotel, networking, Photo, Restaurant, Travel PermalinkIn het weekeinde van 22 en 23 september 2012 was er een grootschalige reünie georganiseerd voor en door oud-Multihousers. Grote sponsors van dit idee zijn Inventive en Grand Hotel ter Duin geweest. Het hotel, de bar en het restaurant vond ik echt super! We hebben er heerlijk gegeten, gedronken en geslapen.
Alles over de reünie is te lezen op de website van Inventive. Hieronder vindt je een overzicht van de meegebrachte memorabilia en een hele kleine impressie van het hotel en de reünie - ik heb veel gekletst en weinig foto's gemaakt.
Als je op de memorabilia klikt, wordt er een 12MB grote foto geladen waarop alles wat beter te zien is. Als de foto dan geladen is, kan je met de meeste browsers er nog eens op klikken en dan wordt de foto vergroot tot de werkelijke grootte. Dan kan je alles nóg beter zien.
Alles over de reünie is te lezen op de website van Inventive. Hieronder vindt je een overzicht van de meegebrachte memorabilia en een hele kleine impressie van het hotel en de reünie - ik heb veel gekletst en weinig foto's gemaakt.
Als je op de memorabilia klikt, wordt er een 12MB grote foto geladen waarop alles wat beter te zien is. Als de foto dan geladen is, kan je met de meeste browsers er nog eens op klikken en dan wordt de foto vergroot tot de werkelijke grootte. Dan kan je alles nóg beter zien.