. $SCRIPTVARS
################################################################################
echo Archive maintenance started at $(date +%X)
. $SCRIPTVARS
################################################################################
echo Archive maintenance started at $(date +%X)
NOTICE="$ftpdir/Archive_Maintenance_In_Progress"
LOCKCU="$lockdir/daily.lock"
LOCKAC="$lockdir/unchecked.lock"
NOTICE="$ftpdir/Archive_Maintenance_In_Progress"
LOCKCU="$lockdir/daily.lock"
LOCKAC="$lockdir/unchecked.lock"
cat > "$NOTICE" <<EOF
Packages are currently being installed and indices rebuilt.
Maintenance is automatic, starting at 13:52 US Central time, and
cat > "$NOTICE" <<EOF
Packages are currently being installed and indices rebuilt.
Maintenance is automatic, starting at 13:52 US Central time, and
################################################################################
echo "Creating pre-daily-cron-job backup of projectb database..."
################################################################################
echo "Creating pre-daily-cron-job backup of projectb database..."
# Update task overrides for testing and unstable
# [JT 2004-02-04 disabled; copying in by hand for now]
# Update task overrides for testing and unstable
# [JT 2004-02-04 disabled; copying in by hand for now]
# Needs to be rebuilt, as files have moved. Due to unaccepts, we need to
# update this before wanna-build is updated.
psql projectb -A -t -q -c "SELECT filename FROM queue_build WHERE suite = 5 AND queue = 0 AND in_queue = true AND filename ~ 'd(sc|eb)$'" > $dbdir/dists/unstable_accepted.list
# Needs to be rebuilt, as files have moved. Due to unaccepts, we need to
# update this before wanna-build is updated.
psql projectb -A -t -q -c "SELECT filename FROM queue_build WHERE suite = 5 AND queue = 0 AND in_queue = true AND filename ~ 'd(sc|eb)$'" > $dbdir/dists/unstable_accepted.list
################################################################################
echo "Creating post-daily-cron-job backup of projectb database..."
################################################################################
echo "Creating post-daily-cron-job backup of projectb database..."
# Vacuum the database
echo "VACUUM; VACUUM ANALYZE;" | psql projectb 2>&1 | grep -v "^NOTICE: Skipping.*only table owner can VACUUM it$"
################################################################################
# Vacuum the database
echo "VACUUM; VACUUM ANALYZE;" | psql projectb 2>&1 | grep -v "^NOTICE: Skipping.*only table owner can VACUUM it$"
################################################################################
+
+TS=$(($TS+1)); echo Archive maintenance timestamp $TS: $(date +%X)
+
+# Clean up apt-ftparchive's databases
+
+cd $configdir
+apt-ftparchive -q clean apt.conf
+
+################################################################################