aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authoronefang2023-05-11 15:24:15 +1000
committeronefang2023-05-11 15:24:15 +1000
commit9967b8231a083c630eea042ce93c2b003ee892c1 (patch)
tree64ac9a39176625bc011f2e63dd17a67e5a57e88a
parentUpdate base-files version. (diff)
downloadapt-panopticon-9967b8231a083c630eea042ce93c2b003ee892c1.zip
apt-panopticon-9967b8231a083c630eea042ce93c2b003ee892c1.tar.gz
apt-panopticon-9967b8231a083c630eea042ce93c2b003ee892c1.tar.bz2
apt-panopticon-9967b8231a083c630eea042ce93c2b003ee892c1.tar.xz
Clean up messes and old results.
Diffstat (limited to '')
-rwxr-xr-xupdate_apt-panopticon18
1 files changed, 16 insertions, 2 deletions
diff --git a/update_apt-panopticon b/update_apt-panopticon
index 180f090..ef4c740 100755
--- a/update_apt-panopticon
+++ b/update_apt-panopticon
@@ -1,11 +1,14 @@
1#!/bin/bash 1#!/bin/bash
2 2
3cd /var/www/html/apt-panopticon/apt-panopticon_cgp 3PANOPATH="/var/www/html/apt-panopticon"
4#KEEPDAYS=$((2 * 30))
5
6cd ${PANOPATH}/apt-panopticon_cgp
4if [ -d .git ] ; then 7if [ -d .git ] ; then
5 git pull > /dev/null 8 git pull > /dev/null
6 chown -R www-data:www-data * 9 chown -R www-data:www-data *
7fi 10fi
8cd /var/www/html/apt-panopticon/apt-panopticon 11cd ${PANOPATH}/apt-panopticon
9if [ -d .git ] ; then 12if [ -d .git ] ; then
10 git pull > /dev/null 13 git pull > /dev/null
11 chown -R www-data:www-data * 14 chown -R www-data:www-data *
@@ -28,6 +31,14 @@ if [ -f apt-panopticon.lock ] ; then
28 rm apt-panopticon.lock 31 rm apt-panopticon.lock
29fi 32fi
30 33
34# Clean up any mess left over from failed runs.
35find results_* -maxdepth 2 ! -name "pkgmaster.devuan.org" -name "*.*" -type d -print0 | xargs -0rt /bin/rm -fr
36
37if [ "z" != "z${KEEPDAYS}" ] ; then
38 # Remove old results.
39 find . -daystart -maxdepth 2 -name "stamp" -type f ! -mtime $((0 - ${KEEPDAYS})) -printf "%h\0" | xargs -0rt /bin/rm -fr
40fi
41
31rm ../results; ln -s apt-panopticon/results_old ../results 42rm ../results; ln -s apt-panopticon/results_old ../results
32flock -n apt-panopticon.lock ionice -c3 nice -n 19 timeout --kill-after=20.0 --foreground 8.5m ./apt-panopticon.lua && rm apt-panopticon.lock 43flock -n apt-panopticon.lock ionice -c3 nice -n 19 timeout --kill-after=20.0 --foreground 8.5m ./apt-panopticon.lua && rm apt-panopticon.lock
33if [ -f apt-panopticon.lock ] ; then 44if [ -f apt-panopticon.lock ] ; then
@@ -37,3 +48,6 @@ fi
37rm ../results; ln -s apt-panopticon/results ../results 48rm ../results; ln -s apt-panopticon/results ../results
38 49
39chown -R www-data:www-data * 50chown -R www-data:www-data *
51
52# Clean up any mess left over from THIS failed run.
53find results_* -maxdepth 2 ! -name "pkgmaster.devuan.org" -name "*.*" -type d -print0 | xargs -0rt /bin/rm -fr