Let my HOME alone 1/2
This commit is contained in:
parent
2ae37e902e
commit
a83e45df5e
94 changed files with 328 additions and 58 deletions
20
config/scripts/syncthingRestore
Executable file
20
config/scripts/syncthingRestore
Executable file
|
@ -0,0 +1,20 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
import os
|
||||
import shutil
|
||||
|
||||
curDir = os.path.realpath('.')
|
||||
assert '.stversions/' in curDir
|
||||
tgDir = curDir.replace('.stversions/', '')
|
||||
|
||||
|
||||
for root, dirs, files in os.walk(curDir):
|
||||
dstRoot = root.replace(curDir, tgDir)
|
||||
os.makedirs(dstRoot, exist_ok=True)
|
||||
for f in files:
|
||||
srcPath = os.path.join(root, f)
|
||||
dstF = f
|
||||
dstPath = os.path.join(dstRoot, dstF)
|
||||
print(f"{srcPath} → {dstPath}")
|
||||
shutil.copy2(srcPath, dstPath)
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue