aboutsummaryrefslogtreecommitdiffstats
path: root/modules/draklive/files/clean-live.sh
blob: cceb6a4aa768ce0a50a7a027b51b08ea710fc5f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/bash

# clean old draklive build sets
DRAKLIVE_ROOT=/var/lib/draklive
RM="rm -rf"

# keep only chroot/build sets from previous day
MAX_BUILD_AGE=1
find $DRAKLIVE_ROOT/{chroot/*,build/*/*} -maxdepth 0 -not -name dist -mtime +$(expr $MAX_BUILD_AGE - 1) -exec $RM {} \;

# keep dist (iso + lists) for all sets during 20 days
MAX_DIST_AGE=20
find $DRAKLIVE_ROOT/build/*/dist -maxdepth 0 -mtime +$(expr $MAX_DIST_AGE - 1) -exec $RM {} \;

find $DRAKLIVE_ROOT/build -maxdepth 1 -links 2 -exec rmdir {} \;