Badal commited on
Commit ·
51c05f7
1
Parent(s): 155a456
Backup every 3 seconds
Browse files- entrypoint.sh +9 -4
entrypoint.sh
CHANGED
|
@@ -51,15 +51,20 @@ while true; do
|
|
| 51 |
exit 1
|
| 52 |
fi
|
| 53 |
|
| 54 |
-
# Sync local TO bucket (backup)
|
|
|
|
| 55 |
hf sync "$SOURCE" "$BUCKET" \
|
| 56 |
--exclude 'bun/*' \
|
| 57 |
--exclude '.bun/*' \
|
| 58 |
--exclude '*/cache/*' \
|
| 59 |
--exclude 'node_modules/*' \
|
| 60 |
-
--delete
|
| 61 |
-
--quiet
|
| 62 |
|
| 63 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
sleep 3
|
| 65 |
done
|
|
|
|
| 51 |
exit 1
|
| 52 |
fi
|
| 53 |
|
| 54 |
+
# Sync local TO bucket (backup)
|
| 55 |
+
echo "$(date): Syncing backup..."
|
| 56 |
hf sync "$SOURCE" "$BUCKET" \
|
| 57 |
--exclude 'bun/*' \
|
| 58 |
--exclude '.bun/*' \
|
| 59 |
--exclude '*/cache/*' \
|
| 60 |
--exclude 'node_modules/*' \
|
| 61 |
+
--delete
|
|
|
|
| 62 |
|
| 63 |
+
if [ $? -eq 0 ]; then
|
| 64 |
+
echo "$(date): Backup cycle complete."
|
| 65 |
+
else
|
| 66 |
+
echo "$(date): Backup failed!"
|
| 67 |
+
fi
|
| 68 |
+
|
| 69 |
sleep 3
|
| 70 |
done
|