david_williams | e529817 | 2007-12-20 03:30:54 +0000 | [diff] [blame] | 1 | #!/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) |
| 7 | if [ -n $BUILD_INITIALIZED ] |
| 8 | then |
| 9 | source commonVariations.shsource |
| 10 | source ${BUILD_HOME}/releng.control/commonComputedVariables.shsource |
| 11 | fi |
| 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_williams | e0f67a3 | 2007-12-20 03:39:17 +0000 | [diff] [blame^] | 17 | # set at 10 days, under assumption that before that time, |
| 18 | # artifacts will be "saved" elsewhere, if needed. |
| 19 | n=10; |
david_williams | e529817 | 2007-12-20 03:30:54 +0000 | [diff] [blame] | 20 | |
| 21 | echo " Removing artifact directories older than $n days"; |
| 22 | echo " number of directories before cleaning: "; |
david_williams | 50cfbbf | 2007-12-20 03:36:19 +0000 | [diff] [blame] | 23 | find ${BUILD_HOME}/artifacts -mindepth 2 -maxdepth 2 | wc -l |
david_williams | e529817 | 2007-12-20 03:30:54 +0000 | [diff] [blame] | 24 | |
david_williams | 50cfbbf | 2007-12-20 03:36:19 +0000 | [diff] [blame] | 25 | find ${BUILD_HOME}/artifacts -mindepth 2 -maxdepth 2 -ctime +$n -exec rm -fr '{}' \; |
david_williams | e529817 | 2007-12-20 03:30:54 +0000 | [diff] [blame] | 26 | |
| 27 | echo " number of directories after cleaning: "; |
david_williams | 50cfbbf | 2007-12-20 03:36:19 +0000 | [diff] [blame] | 28 | find ${BUILD_HOME}/artifacts -mindepth 2 -maxdepth 2 | wc -l |