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