-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from docker/3.3instrumenting
set cron job to run at random time between midnight and 4am
- Loading branch information
Showing
3 changed files
with
17 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,21 @@ | ||
| #!/bin/sh | ||
| #!/bin/bash | ||
| #set env vars for cron job | ||
| /opt/tier/setenv.sh | ||
|
|
||
| #build crontab file with random start time between midnight and 3:59am | ||
| echo "#send daily beacon to TIER Central" > /opt/tier/tier-cron | ||
| echo "* * * * * /usr/bin/sendtierbeacon.sh >> /var/log/cron.log 2>&1" >> /opt/tier/tier-cron | ||
| echo "#"$(expr $RANDOM % 59) $(expr $RANDOM % 3) "* * * /usr/bin/sendtierbeacon.sh >> /var/log/cron.log 2>&1" >> /opt/tier/tier-cron | ||
| chmod 644 /opt/tier/tier-cron | ||
|
|
||
| #install crontab | ||
| crontab /opt/tier/tier-crontab | ||
|
|
||
| #create cron logfile | ||
| touch /var/log/cron.log | ||
|
|
||
| #start crond | ||
| /usr/sbin/crond | ||
|
|
||
| #start tomcat | ||
| /usr/local/tomcat/bin/catalina.sh run |
This file was deleted.
Oops, something went wrong.