Commit d2ba789e authored by Nick Elsmore's avatar Nick Elsmore

hooks: Do not delete rootfs after compression

parent 7ed6da8b
......@@ -4,27 +4,14 @@
NOW=$(date +"%Y-%m-%d_%H-%M")
cd $1
mkdir -p ../export
#FNAME=$(basename $1)-$NOW.tgz
FNAME=$(basename $1)
echo Creating ${FNAME}.tgz
if hash pv 2>/dev/null
then
SIZE=$(du -sb . | awk '{print $1}')
tar cf - . | pv -s $SIZE | gzip --rsyncable > ../export/${FNAME}.tgz
#tar cf - . | pv -s $SIZE > ../export/${FNAME}.tar
tar cf - . | pv -s $SIZE | gzip --rsyncable > ../${FNAME}.tgz
else
tar cf - . | gzip --rsyncable > ../export/${FNAME}.tgz
#tar cf - . > ../export/${FNAME}.tgz
tar cf - . | gzip --rsyncable > ../${FNAME}.tgz
fi
#echo Creating ${FNAME}.tar.xz
#tar cf - . | pv -s $SIZE | xz --block-size=16M > ../export/${FNAME}.tar.xz
cd ../export/
#sha256sum ${FNAME}.tgz > ${FNAME}.tgz.sha256
#sha256sum ${FNAME}.tar.xz > ${FNAME}.tar.xz.sha256
#ln -sf ${FNAME} $(basename $1)-latest.tgz
rm $1 -rf
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment