aboutsummaryrefslogtreecommitdiff
path: root/exp
diff options
context:
space:
mode:
authorn-peugnet <n.peugnet@free.fr>2021-10-19 14:21:15 +0200
committern-peugnet <n.peugnet@free.fr>2021-10-19 14:21:15 +0200
commit157e94222bc72ebc27a05f694ca8e9558435ab5a (patch)
tree02e6f982ab5a4093f78a848daf3cd8d1bb4e0cbf /exp
parente79080490330a0c7d36bd85935c04200c63aa185 (diff)
downloaddna-backup-157e94222bc72ebc27a05f694ca8e9558435ab5a.tar.gz
dna-backup-157e94222bc72ebc27a05f694ca8e9558435ab5a.zip
update scripts and README
Diffstat (limited to 'exp')
-rw-r--r--exp/Makefile9
-rwxr-xr-xexp/exp.sh10
2 files changed, 15 insertions, 4 deletions
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 $</*; do \
last=`cut -f1 $$i`; \
@@ -115,7 +116,7 @@ $(NOPACK).size: $(NOPACK).versions run
| sort -k2 \
> $@
-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