[Qa-jenkins-scm] [jenkins.debian.net] 01/02: reproducible: db maintenance only on jenkins
Holger Levsen
holger at moszumanska.debian.org
Tue Aug 4 13:15:53 UTC 2015
This is an automated email from the git hooks/post-receive script.
holger pushed a commit to branch master
in repository jenkins.debian.net.
commit dfbd71c34b82f956133e362478d6228121e6d19e
Author: Holger Levsen <holger at layer-acht.org>
Date: Tue Aug 4 15:13:14 2015 +0200
reproducible: db maintenance only on jenkins
---
bin/reproducible_maintenance.sh | 42 +++++++++++++++++++++--------------------
1 file changed, 22 insertions(+), 20 deletions(-)
diff --git a/bin/reproducible_maintenance.sh b/bin/reproducible_maintenance.sh
index 49ef8ec..7b434a9 100755
--- a/bin/reproducible_maintenance.sh
+++ b/bin/reproducible_maintenance.sh
@@ -12,29 +12,31 @@ common_init "$@"
DIRTY=false
-# prepare backup
-REP_RESULTS=/srv/reproducible-results
-mkdir -p $REP_RESULTS/backup
-cd $REP_RESULTS/backup
-
-# keep 30 days and the 1st of the month
-DAY=(date -d "30 day ago" '+%d')
-DATE=$(date -d "30 day ago" '+%Y-%m-%d')
-if [ "$DAY" != "01" ] && [ -f reproducible_$DATE.db.xz ] ; then
- rm -f reproducible_$DATE.db.xz
-fi
+if [ "$HOSTNAME" = "jenkins" ] ; then
+ # prepare backup
+ REP_RESULTS=/srv/reproducible-results
+ mkdir -p $REP_RESULTS/backup
+ cd $REP_RESULTS/backup
+
+ # keep 30 days and the 1st of the month
+ DAY=(date -d "30 day ago" '+%d')
+ DATE=$(date -d "30 day ago" '+%Y-%m-%d')
+ if [ "$DAY" != "01" ] && [ -f reproducible_$DATE.db.xz ] ; then
+ rm -f reproducible_$DATE.db.xz
+ fi
-# actually do the backup
-DATE=$(date '+%Y-%m-%d')
-if [ ! -f reproducible_$DATE.db.xz ] ; then
- cp -v $PACKAGES_DB .
+ # actually do the backup
DATE=$(date '+%Y-%m-%d')
- mv -v reproducible.db reproducible_$DATE.db
- xz reproducible_$DATE.db
-fi
+ if [ ! -f reproducible_$DATE.db.xz ] ; then
+ cp -v $PACKAGES_DB .
+ DATE=$(date '+%Y-%m-%d')
+ mv -v reproducible.db reproducible_$DATE.db
+ xz reproducible_$DATE.db
+ fi
-# provide copy for external backups
-cp -v $PACKAGES_DB $BASE/
+ # provide copy for external backups
+ cp -v $PACKAGES_DB $BASE/
+fi
# delete old temp directories
OLDSTUFF=$(find $REP_RESULTS -maxdepth 1 -type d -name "tmp.*" -mtime +2 -exec ls -lad {} \;)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/qa/jenkins.debian.net.git
More information about the Qa-jenkins-scm
mailing list