Browse Source

fix error,最后少于size压缩

liuyuqi-dellpc 8 months ago
parent
commit
17b0efbadb
1 changed files with 7 additions and 0 deletions
  1. 7 0
      shell/tar.py

+ 7 - 0
shell/tar.py

@@ -30,3 +30,10 @@ for path in os.listdir(rootPath):
             currentDir=""
             count2 = count2 + 1
         count = count + 1
+
+# Check if there are remaining directories to include in a tar.gz file
+if currentDir != "":
+    shellStr = "tar -zcf /ossfs/crawl-mrdx/mrdx%s.tar.gz" % (
+        count2) + currentDir
+    print(shellStr)
+    os.system(shellStr)