blob: 327090693377bd314fe25c0e6ebc1c7c91d94925 [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
david_williamse0f67a32007-12-20 03:39:17 +000017# set at 10 days, under assumption that before that time,
18# artifacts will be "saved" elsewhere, if needed.
19n=10;
david_williamse5298172007-12-20 03:30:54 +000020
21echo " Removing artifact directories older than $n days";
22echo " number of directories before cleaning: ";
david_williams50cfbbf2007-12-20 03:36:19 +000023find ${BUILD_HOME}/artifacts -mindepth 2 -maxdepth 2 | wc -l
david_williamse5298172007-12-20 03:30:54 +000024
david_williams50cfbbf2007-12-20 03:36:19 +000025find ${BUILD_HOME}/artifacts -mindepth 2 -maxdepth 2 -ctime +$n -exec rm -fr '{}' \;
david_williamse5298172007-12-20 03:30:54 +000026
27echo " number of directories after cleaning: ";
david_williams50cfbbf2007-12-20 03:36:19 +000028find ${BUILD_HOME}/artifacts -mindepth 2 -maxdepth 2 | wc -l