title: Cron in postgresql:alpine docker container
body: <p>I am using the "plain" postgresql:alpine docker image, but have to schedule a database backup daily. I think this is a pretty common task.</p>
  
  <p>I created a script <code>backup</code>and stored in the container in <code>/etc/periodic/15min</code>, and made it executable:</p>
  
  <pre><code>bash-4.4# ls -l /etc/periodic/15min/
  total 4
  -rwxr-xr-x    1 root     root            95 Mar  2 15:44 backup
  </code></pre>
  
  <p>I tried executing it manually, that works fine. </p>
  
  <p><strong>My problem is getting <code>crond</code> to run  automatically.</strong></p>
  
  <p>If I exec <code>docker exec my-postgresql-container crond</code>, the deamon is started and cron works, but <strong>I would like to embed this into my Dockerfile</strong></p>
  
  <pre><code>FROM postgres:alpine
  
  # my backup script, MUST NOT have .sh extension
  COPY backup.sh /etc/periodic/15min/backup 
  RUN chmod a+x /etc/periodic/15min/backup
  
  RUN crond # &lt;- doesn't work
  </code></pre>
  
  <p>I have no idea how to rewrite or overwrite the commands in the official image. For update reasons I also would like to stay on these images, if possible.</p>