-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add cron containers to support running regular crontab
- Loading branch information
1 parent
c51a5a4
commit af76d4b
Showing
21 changed files
with
293 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
.docker-sync | ||
.env | ||
.env | ||
!.gitkeep | ||
/cron.d/*.cron |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
# Add any .cron file or multiple .cron fils with your crontabs here in this folder |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# You can use this crontab as a template just copy it to mycrontab.cron and run the container | ||
# The part "> /proc/1/fd/1 2>/proc/1/fd/2" makes sure the output goes to the docker logs | ||
|
||
# keep this line for ensuring the correct bin paths for all containers | ||
PATH=$PATH:/usr/bin:/usr/local/bin | ||
|
||
* * * * * cd /var/www/totara/src && php admin/cli/cron.php > /proc/1/fd/1 2>/proc/1/fd/2 |
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
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM totara/docker-dev-php54:latest | ||
|
||
RUN apt-get update && apt-get install -y cron | ||
|
||
COPY entrypoint.sh /entrypoint.sh | ||
|
||
RUN chmod +x /entrypoint.sh | ||
|
||
CMD /entrypoint.sh |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
|
||
if [ -e /etc/cron.d/*.cron ] | ||
then | ||
# Install new crontab using all .cron files | ||
cat /etc/cron.d/*.cron | crontab - \ | ||
&& crontab -l \ | ||
&& cron -f | ||
else | ||
echo "No .cron files found in cron.d folder" | ||
fi |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM totara/docker-dev-php55:latest | ||
|
||
RUN apt-get update && apt-get install -y cron | ||
|
||
COPY entrypoint.sh /entrypoint.sh | ||
|
||
RUN chmod +x /entrypoint.sh | ||
|
||
CMD /entrypoint.sh |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
|
||
if [ -e /etc/cron.d/*.cron ] | ||
then | ||
# Install new crontab using all .cron files | ||
cat /etc/cron.d/*.cron | crontab - \ | ||
&& crontab -l \ | ||
&& cron -f | ||
else | ||
echo "No .cron files found in cron.d folder" | ||
fi |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM totara/docker-dev-php56:latest | ||
|
||
RUN apt-get update && apt-get install -y cron | ||
|
||
COPY entrypoint.sh /entrypoint.sh | ||
|
||
RUN chmod +x /entrypoint.sh | ||
|
||
CMD /entrypoint.sh |
Oops, something went wrong.