blob: d68a3dfe784cd8262a1b5037698450089a1cb7ac [file] [log] [blame]
david_williamse5298172007-12-20 03:30:54 +00001#!/bin/sh
2
3
4# remember to leave no slashes on filename in source command,
5# (the commonVariations.shsource file, that is)
6# so that users path is used to find it (first)
7if [ -n $BUILD_INITIALIZED ]
8then
9 source commonVariations.shsource
10 source ${BUILD_HOME}/releng.control/commonComputedVariables.shsource
11fi
12
13# remove artifacts over n days old
14# (where hours = 24 + (n * 24), basically, so that
15# even n=0 means "1 day")
16
17n=4;
18
19echo " Removing artifact directories older than $n days";
20echo " number of directories before cleaning: ";
21find ./ -mindepth 2 -maxdepth 2 | wc -l
22
23find ./ -mindepth 2 -maxdepth 2 -ctime +$n -exec rm -fr '{}' \;
24
25echo " number of directories after cleaning: ";
26find ./ -mindepth 2 -maxdepth 2 | wc -l