Skip to content
Snippets Groups Projects
Commit 5df3b857 authored by SirWalross's avatar SirWalross
Browse files

Fix lock mechanism and other small updates

parent 7ada1bbd
No related branches found
No related tags found
No related merge requests found
......@@ -133,6 +133,7 @@ def loop(con1: serial.Serial, con2: serial.Serial):
write_data()
@log_profile("main")
def main() -> None:
print("Starting")
try:
......
#!/bin/bash
# wait until all other instances of the script are finished
while pidof -o %PPID -x "pull.bash">/dev/null; do
# check every 60 seconds
sleep 60
done
cd `dirname "$0"`/..
echo -e "\n\n#####################################################################"
echo $( date '+%F %H:%M:%S' ) | tee -a bash.log
git pull 2>&1 | tee -a bash.log
echo "" | tee -a bash.log
scripts/./push.bash 2>&1 | tee -a bash.log
echo "" | tee -a bash.log
\ No newline at end of file
#!/bin/bash
ls -la .
ls -la data
ls -la logs
# wait until all other instances of the script are finished
while pidof -x "python3 main.py">/dev/null; do
# check every 60 seconds
echo "python3 main.py is still running, checking in 60 seconds."
sleep 60
done
sleep 10
ps aux
scripts/./write.bash
pip3 install multiprocessing_logging
sleep 10
python3 measure.py
git add .
git commit -m "New data" && git push --force
sleep 10
echo -e "Starting python script:\n"
loop_count=1
while : ; do
......@@ -29,3 +35,7 @@ while : ; do
loop_count=$((loop_count + 1))
sleep $((loop_count * 60))
done
git pull
git add .
git commit -m "New data" && git push --force
\ No newline at end of file
......@@ -17,6 +17,7 @@ then
serial_dms=/dev/ttyACM1
else
echo -e "\x1b[31mError: Something went wrong.\x1b[0m"
echo "$id"
echo -e "Exiting"
exit 1
fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment