Add hs_* temp cleanup at START of sync (before Step 0)
This commit is contained in:
13
sync.sh
13
sync.sh
@@ -1,4 +1,17 @@
|
||||
#!/bin/bash
|
||||
|
||||
# ── Step 0.5: Clean stale temp directories from previous runs ────────────
|
||||
python3 << 'CLEANUP'
|
||||
import shutil, glob, os
|
||||
for prefix in ['hs_merge_', 'hs_exp_', 'hs_rest_']:
|
||||
for d in glob.glob(os.path.join('/tmp', prefix + '*')):
|
||||
try:
|
||||
shutil.rmtree(d)
|
||||
print(f'Cleaned: {d}')
|
||||
except Exception as e:
|
||||
print(f'Failed to clean {d}: {e}')
|
||||
CLEANUP
|
||||
|
||||
set -e
|
||||
|
||||
SYNC_DIR="${SYNC_DIR:-$HOME/.hermes-sync}"
|
||||
|
||||
Reference in New Issue
Block a user