Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
MessdatenSilo
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lennard Kloock
MessdatenSilo
Commits
5df3b857
Commit
5df3b857
authored
Jun 13, 2022
by
SirWalross
Browse files
Options
Downloads
Patches
Plain Diff
Fix lock mechanism and other small updates
parent
7ada1bbd
No related branches found
Tags
Tags containing commit
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
measure.py
+1
-0
1 addition, 0 deletions
measure.py
scripts/pull.bash
+0
-7
0 additions, 7 deletions
scripts/pull.bash
scripts/push.bash
+18
-8
18 additions, 8 deletions
scripts/push.bash
scripts/write.bash
+1
-0
1 addition, 0 deletions
scripts/write.bash
with
20 additions
and
15 deletions
measure.py
+
1
−
0
View file @
5df3b857
...
@@ -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
:
...
...
This diff is collapsed.
Click to expand it.
scripts/pull.bash
+
0
−
7
View file @
5df3b857
#!/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
This diff is collapsed.
Click to expand it.
scripts/push.bash
+
18
−
8
View file @
5df3b857
#!/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
This diff is collapsed.
Click to expand it.
scripts/write.bash
+
1
−
0
View file @
5df3b857
...
@@ -17,6 +17,7 @@ then
...
@@ -17,6 +17,7 @@ then
serial_dms
=
/dev/ttyACM1
serial_dms
=
/dev/ttyACM1
else
else
echo
-e
"
\x
1b[31mError: Something went wrong.
\x
1b[0m"
echo
-e
"
\x
1b[31mError: Something went wrong.
\x
1b[0m"
echo
"
$id
"
echo
-e
"Exiting"
echo
-e
"Exiting"
exit
1
exit
1
fi
fi
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment