From bc7a04373dd7d8c8f4fe537179ac589c5422acdf Mon Sep 17 00:00:00 2001 From: justuser Date: Fri, 10 Jan 2025 19:43:03 +0300 Subject: [PATCH] UP --- sync.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 sync.sh diff --git a/sync.sh b/sync.sh new file mode 100644 index 0000000..7106803 --- /dev/null +++ b/sync.sh @@ -0,0 +1,17 @@ +# Update at the start (we don't know if file changed) +git add * +git commit -m 'sync' +git push + +while true +do +#last_changed=$(find . -mmin -1) +# Update if file changed 10 seconds ago +last_changed=$(find . -type f -newermt "10 seconds ago") +if [ "$last_changed" != "" ]; then + git add * + git commit -m 'sync' + git push +fi +sleep 5 +done