Commit 6199b6cd authored by Michiel de Jong's avatar Michiel de Jong

run backups in the foreground

parent bbaa74ba
......@@ -5,7 +5,6 @@ ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update \
&& apt-get -yq install \
apache2 \
cron \
curl \
git \
libapache2-mod-php5 \
......@@ -22,7 +21,6 @@ RUN apt-get update \
# Add image configuration and scripts
COPY default.conf /etc/apache2/sites-enabled/000-default.conf
COPY run.sh /run.sh
COPY backup.cron /etc/cron.d/backup.cron
RUN sed -i "s/variables_order.*/variables_order = \"EGPCS\"/g" /etc/php5/apache2/php.ini \
&& a2enmod rewrite \
&& chmod 755 /run.sh
......
42 * * * * root cd /data; mysqldump --all-databases > dump.sql; git add *; git commit -am"backup `date`"
......@@ -11,4 +11,14 @@ exec cron &
sleep 5
mysql < /data/dump.sql
source /etc/apache2/envvars
exec apache2 -D FOREGROUND
exec apache2 &
cd /data
while (1); do
mysqldump --all-databases > dump.sql;
git add *;
git commit -am"backup `date`";
git status;
date;
echo "Next backup in one hour...";
sleep 3540;
done
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment