From 157e94222bc72ebc27a05f694ca8e9558435ab5a Mon Sep 17 00:00:00 2001 From: n-peugnet Date: Tue, 19 Oct 2021 14:21:15 +0200 Subject: update scripts and README --- exp/Makefile | 9 +++++---- exp/exp.sh | 10 ++++++++++ 2 files changed, 15 insertions(+), 4 deletions(-) (limited to 'exp') diff --git a/exp/Makefile b/exp/Makefile index 734c40b..b7511fd 100644 --- a/exp/Makefile +++ b/exp/Makefile @@ -48,7 +48,8 @@ export GIT_PATH ?= $(abspath git) GITC := git -C $(REPO_PATH) DNADIRS := $(DNA_4K) $(DNA_8K) -DATADIRS := $(DNA_4K) $(DNA_8K) $(DIFFS) $(NOPACK) $(BORG) $(TARGZ) $(REAL) +DNAEXPORT := $(DNADIRS:%=%_export) +DATADIRS := $(DNADIRS) $(DNAEXPORT) $(DIFFS) $(NOPACK) $(BORG) $(TARGZ) $(REAL) SIZEFILES := $(DATADIRS:%=%.size) .PHONY: all exp @@ -76,7 +77,7 @@ $(DNADIRS:%=%.size) $(REAL).size: %.size: %.versions run cut -f1 $$i | paste -sd+ | bc >> $@; \ done -$(BORG).size: $(BORG).versions run +$(BORG).size $(DNAEXPORT:%=%.size): %.size: %.versions run rm -rf $@ prev=0; for i in $ $@ -run: $(COMMITS) $(DNA_BACKUP) $(DNA_PARAMS) | printvars $(DATADIRS) $(NOPACK).versions $(BORG).versions $(REAL).versions +run: $(COMMITS) $(DNA_BACKUP) $(DNA_PARAMS) | printvars $(DATADIRS) $(NOPACK).versions $(BORG).versions $(REAL).versions $(DNAEXPORT:%=%.versions) rm -rf $(DATADIRS:%=%/*) $(DATADIRS:%=%.versions/*) ./exp.sh touch $@ @@ -130,7 +131,7 @@ $(DNA_PARAMS): echo "$(DNA_4K) -c 4096" >> $@ echo "$(DNA_8K) -c 8192" >> $@ -$(DATADIRS) $(NOPACK).versions $(BORG).versions $(REAL).versions: +$(DATADIRS) $(NOPACK).versions $(BORG).versions $(REAL).versions $(DNAEXPORT:%=%.versions): mkdir $@ $(DNA_BACKUP): .FORCE diff --git a/exp/exp.sh b/exp/exp.sh index e8f6bd7..6071a46 100755 --- a/exp/exp.sh +++ b/exp/exp.sh @@ -130,6 +130,16 @@ do do log "create $name backup for this version" $DNA_BACKUP commit -v 2 $flags $REPO_PATH $name + + log "create $name export for this version" + export=/tmp/dna-backup-exp-export + rm -rf $export + $DNA_BACKUP export -v 2 $flags $name $export + find $export -type f -exec du -ba {} + \ + | cut -f1 \ + | paste -sd+ \ + | bc \ + > $(printf "%s_export.versions/%05d" $name $i) done fi -- cgit v1.2.3