Mineyev_Roman_I_rmineyev3 commited on
Commit ·
09204af
1
Parent(s): c75cb8b
Add images batch 20260512_222325
Browse files
upload.sh
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
|
| 3 |
+
# Uploads new images to Hugging Face repo every 5 minutes if there are changes.
|
| 4 |
+
# Usage: Go to terminal, go to microscope-data directory, and run `./upload.sh`
|
| 5 |
+
|
| 6 |
+
INTERVAL=310 # 5 min + buffer
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
while true; do
|
| 10 |
+
# Check if there's anything new to commit
|
| 11 |
+
if [[ -n $(git status --porcelain) ]]; then
|
| 12 |
+
echo "[$(date)] Adding and committing..."
|
| 13 |
+
git add .
|
| 14 |
+
git commit -m "Add images batch $(date +%Y%m%d_%H%M%S)"
|
| 15 |
+
git push
|
| 16 |
+
echo "[$(date)] Pushed successfully."
|
| 17 |
+
else
|
| 18 |
+
echo "[$(date)] Nothing new to commit."
|
| 19 |
+
fi
|
| 20 |
+
|
| 21 |
+
sleep $INTERVAL
|
| 22 |
+
done
|