Browse Source

don't gzip exported containers

Josh Bicking 6 years ago
parent
commit
883372dde4
1 changed files with 5 additions and 3 deletions
  1. 5 3
      docker-backup.sh

+ 5 - 3
docker-backup.sh

@@ -12,7 +12,7 @@ while getopts "h?v:o:na" opt; do
     case "$opt" in
     case "$opt" in
         h|\?)
         h|\?)
             echo "
             echo "
-    docker-backup.sh stops all running containers, exports them and gzips them to the
+    docker-backup.sh stops all running containers, exports them and tars them to the
     current directory, then restarts the previously running containers in the reverse
     current directory, then restarts the previously running containers in the reverse
     order of which they were stopped.
     order of which they were stopped.
 
 
@@ -89,7 +89,7 @@ wait
 echo Exporting containers...
 echo Exporting containers...
 for i in $CONTAINERS
 for i in $CONTAINERS
 do
 do
-    docker export $i | gzip -c > $OUTDIR/$i-$(date +%Y%m%d-%H%M%S).tar.gz && echo "Exported "$i &
+    docker export $i > $OUTDIR/$i.tar && echo "Exported "$i &
 done
 done
 
 
 wait
 wait
@@ -103,12 +103,14 @@ then
 
 
     for i in $VOLUMES
     for i in $VOLUMES
     do
     do
-        tar czf $OUTDIR/$(basename $i)-$(date +%Y%m%d-%H%M%S).tar.gz $i && echo "Backed up "$i &
+        tar cf $OUTDIR/$(basename $i).tar $i && echo "Backed up "$i &
     done
     done
 
 
     IFS=$OLDIFS
     IFS=$OLDIFS
 fi
 fi
 
 
+wait
+
 # Restart previously running containers (if any were given or it was requested)
 # Restart previously running containers (if any were given or it was requested)
 if [ ! $NOAUTORESTART ]
 if [ ! $NOAUTORESTART ]
 then
 then