Skip to content

Commit

Permalink
Merge pull request kartoza#25 from gis-ops/master
Browse files Browse the repository at this point in the history
Change cron logic to use /var/spool/crontabs
  • Loading branch information
mazano authored and nilsnolde committed Nov 18, 2019
2 parents 8a7993e + 0796162 commit 2921ba1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
13 changes: 6 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
FROM kartoza/postgis:11.0-2.5
MAINTAINER [email protected]

RUN apt-get -y update; apt-get install -y postgresql-client
ADD backups-cron /etc/cron.d/backups-cron
RUN touch /var/log/cron.log
ADD backups.sh /backups.sh
ADD restore.sh /restore.sh
ADD start.sh /start.sh

ENTRYPOINT []
CMD ["/start.sh"]
COPY backups-cron /backups-cron
COPY backups.sh /backups.sh
COPY restore.sh /restore.sh
COPY start.sh /start.sh

ENTRYPOINT ["/bin/bash", "/start.sh"]
4 changes: 2 additions & 2 deletions backups-cron
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# For testing - run every minute
#*/1 * * * * root /backups.sh 2>&1
*/1 * * * * /backups.sh 2>&1

# Run the backups at 11pm each night
0 23 * * * root /backups.sh 2>&1
0 23 * * * /backups.sh 2>&1

# We need a blank line here for it to be a valid cron file
1 change: 1 addition & 0 deletions start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,6 @@ echo "Start script running with these environment options"
set | grep PG

# Now launch cron in then foreground.
crontab /backups-cron

cron -f

0 comments on commit 2921ba1

Please sign in to comment.