Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
sensapex_motion_control
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
HaissLab
Setups Code
sensapex_motion_control
Commits
d72a52a4
Commit
d72a52a4
authored
1 year ago
by
Timothe Jost
Browse files
Options
Downloads
Patches
Plain Diff
cronjob rename
parent
6827b801
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
cronjob.sh
+16
-15
16 additions, 15 deletions
cronjob.sh
with
16 additions
and
15 deletions
conjob.sh
→
c
r
onjob.sh
+
16
−
15
View file @
d72a52a4
...
@@ -19,21 +19,22 @@ start_task() {
...
@@ -19,21 +19,22 @@ start_task() {
echo
$!
>
"
$PIDFILE
"
echo
$!
>
"
$PIDFILE
"
}
}
# Check if the PID file exists
# # Check if the PID file exists
if
[
-f
"
$PIDFILE
"
]
;
then
# if [ -f "$PIDFILE" ]; then
PID
=
$(
cat
"
$PIDFILE
"
)
# PID=$(cat "$PIDFILE")
# Check if the process is running
# # Check if the process is running
if
ps
-p
$PID
>
/dev/null
;
then
# if ps -p $PID > /dev/null; then
echo
"Task is already running with PID
$PID
"
>>
"
$LOGFILE
"
# echo "Task is already running with PID $PID" >> "$LOGFILE"
exit
0
# exit 0
else
# else
echo
"Task is not running, but PID file exists. Cleaning up..."
>>
"
$LOGFILE
"
# echo "Task is not running, but PID file exists. Cleaning up..." >> "$LOGFILE"
rm
-f
"
$PIDFILE
"
# rm -f "$PIDFILE"
fi
# fi
fi
# fi
# Start the task
# # Start the task
start_task
# start_task
# sleep 10
# Monitor the task and restart if it crashes
# Monitor the task and restart if it crashes
while
true
;
do
while
true
;
do
...
...
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