OpenTransformer commited on
Commit
6c84677
·
verified ·
1 Parent(s): 70725d3

Upload watchdog.sh with huggingface_hub

Browse files
Files changed (1) hide show
  1. watchdog.sh +11 -0
watchdog.sh ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+ MAX_GB=145
3
+ while true; do
4
+ USED=$(df /workspace | tail -1 | awk '{print int($3/1048576)}')
5
+ if [ "$USED" -ge "$MAX_GB" ]; then
6
+ echo "[WATCHDOG] Disk at ${USED}GB - STOPPING SCRAPER"
7
+ pkill -f turbo_crawl
8
+ exit 0
9
+ fi
10
+ sleep 60
11
+ done