Commit e78d92cd authored by Michiel de Jong's avatar Michiel de Jong

fix the way mysql and backups are started

parent 6199b6cd
git config --global "backup@IndieHosters"
git config --global "IndieHosters backup"
exec mysqld_safe &
for ((i=0;i<10;i++))
DB_CONNECTABLE=$(mysql -e 'status' >/dev/null 2>&1; echo "$?")
if [[ DB_CONNECTABLE -eq 0 ]]; then
echo "Waiting for database server..."
sleep 1
mkdir -p /data/uploads
mkdir -p /data/www-content
touch /data/dump.sql
chown -R root:www-data /data/uploads
chown -R root:www-data /data
chmod -R 770 /data/uploads
chmod -R 750 /data/www-content
exec mysqld_safe &
exec cron &
sleep 5
mysql < /data/dump.sql
source /etc/apache2/envvars
exec apache2 &
cd /data
while (1); do
mysqldump --all-databases > dump.sql;
git add *;
git commit -am"backup `date`";
git status;
echo "Next backup in one hour...";
sleep 3540;
git init
git config --local "backup@IndieHosters"
git config --local "IndieHosters backup"
git config --local push.default simple
while true; do
mysqldump --all-databases > dump.sql
git add *
git commit -am"backup `date`"
git status
echo "Next backup in one hour..."
sleep 3540
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