We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a4144cc commit bb4aea5Copy full SHA for bb4aea5
1 file changed
platform-api/monitor.py
@@ -113,7 +113,18 @@ def _maintenance_loop():
113
time.sleep(300) # Wait 5 min after startup
114
while True:
115
try:
116
- _backup()
+ # Only backup if last one was >12h ago
117
+ import glob
118
+ existing = sorted(glob.glob(os.path.join(BACKUP_DIR, "pleng-*.tar.gz")))
119
+ if existing:
120
+ last_mod = os.path.getmtime(existing[-1])
121
+ hours_since = (time.time() - last_mod) / 3600
122
+ if hours_since < 12:
123
+ logger.info(f"Skipping backup — last one was {hours_since:.1f}h ago")
124
+ else:
125
+ _backup()
126
127
128
except Exception as e:
129
logger.error(f"Backup error: {e}")
130
0 commit comments