Badal commited on
Commit
a8abfdf
·
1 Parent(s): 6a21b54

Real-time continuous sync - no delay

Browse files
Files changed (1) hide show
  1. entrypoint.sh +4 -14
entrypoint.sh CHANGED
@@ -37,26 +37,16 @@ sleep 10
37
  echo '=== [STEP 2] OPENCODE STARTED ==='
38
 
39
  # ============================================
40
- # STEP 3: MONITOR & BACKUP LOOP
41
  # ============================================
42
- echo '=== [STEP 3] STARTING MONITOR & BACKUP SERVICE ==='
43
  while true; do
44
  # Check if OpenCode is still running
45
  if ! pgrep -f 'opencode' > /dev/null; then
46
  echo 'CRITICAL: OpenCode process died! Exiting container...'
47
  exit 1
48
  fi
49
-
50
- # Sync local TO bucket (backup) - full disk sync
51
- echo "$(date): Syncing backup..."
52
- hf sync "$SOURCE" "$BUCKET" \
53
- --delete
54
-
55
- if [ $? -eq 0 ]; then
56
- echo "$(date): Backup cycle complete."
57
- else
58
- echo "$(date): Backup failed!"
59
- fi
60
 
61
- sleep 3
 
62
  done
 
37
  echo '=== [STEP 2] OPENCODE STARTED ==='
38
 
39
  # ============================================
40
+ # STEP 3: REAL-TIME CONTINUOUS SYNC
41
  # ============================================
42
+ echo '=== [STEP 3] STARTING REAL-TIME SYNC ==='
43
  while true; do
44
  # Check if OpenCode is still running
45
  if ! pgrep -f 'opencode' > /dev/null; then
46
  echo 'CRITICAL: OpenCode process died! Exiting container...'
47
  exit 1
48
  fi
 
 
 
 
 
 
 
 
 
 
 
49
 
50
+ # Real-time continuous sync (no interval - continuous!)
51
+ hf sync "$SOURCE" "$BUCKET" --delete
52
  done