forked from Ranossy/plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbackup.py
20 lines (14 loc) · 908 Bytes
/
backup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# coding=utf-8
import os
import os.path
import shutil
import time
source_dir = r"C:\JX3\Game\JX3\bin\zhcn_hd\interface\LR_Plugin"
target_dir = r"j:\剑网3插件制作\提交提交提交提交" + "\\" + time.strftime("%Y%m%d") + "\\LR_Plugin"
ignore = shutil.ignore_patterns("*.py", "*.pyc", "*.key", "*.dat", "*.bak", "*.mp3","@DATA2", "@DATA", ".idea", "__pycache__", "*副本*", "Usrdata", ".git", ".gitignore")
if os.path.exists(target_dir):
shutil.rmtree(target_dir)
shutil.copytree(source_dir, target_dir, ignore = ignore)
zip_command = "7z a " + r"j:\剑网3插件制作\提交提交提交提交" + "\\" + time.strftime("%Y%m%d") + "\\LR_Plugin.zip " + r"j:\剑网3插件制作\提交提交提交提交" + "\\" + time.strftime("%Y%m%d") + "\\LR_Plugin"
os.system(zip_command)
shutil.rmtree(r"j:\剑网3插件制作\提交提交提交提交" + "\\" + time.strftime("%Y%m%d") + "\\LR_Plugin")