Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -178,4 +178,10 @@ ADD ./etc/logrotate/rsyslog-rotate /usr/lib/rsyslog/rsyslog-rotate

VOLUME ["/usr/local/ispconfig/"]

CMD ["/bin/bash", "/start.sh"]
## Initial Backup
ADD ./do-1st-backup.sh /do-1st-backup.sh

## FIX: mysqldump Error: Unknown table ‘COLUMN_STATISTICS’ in information_schema (1109)
RUN echo "column-statistics=0" >> /etc/mysql/conf.d/mysqldump.cnf

CMD ["/bin/bash", "/start.sh"]
37 changes: 37 additions & 0 deletions do-1st-backup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/usr/bin/env bash

output=/var/backup/1st-backup-complete.log

#sleep 30
#echo "Waiting for 30 sec to ensure install is completed before doing the backup"

if [ ! -f "$output" ]
then
echo "Waiting for 30 sec to ensure install is completed before doing the backup"
sleep 30
cp -r --parents /var/lib/amavis/ /data_tmp/
echo "/var/lib/amavis/ backed up 1st time" >> $output
cp -r --parents /etc/amavis/ /data_tmp/
echo "/etc/amavis/ backed up 1st time" >> $output
cp -r --parents /etc/letsencrypt/ /data_tmp/
echo "/etc/letsencrypt/ backed up 1st time" >> $output
cp -r --parents /etc/apache2/sites-available/ /data_tmp/
echo "/etc/apache2/sites-available/ backed up 1st time" >> $output
cp -r --parents /etc/apache2/sites-enabled/ /data_tmp/
echo "/etc/apache2/sites-enabled/ backed up 1st time" >> $output
cp -r --parents /usr/local/ispconfig/ /data_tmp/
echo "/usr/local/ispconfig/ backed up 1st time" >> $output
cp -r --parents /etc/cron.d/ /data_tmp/
echo "/etc/cron.d/ backed up 1st time" >> $output
cp -r --parents /etc/bind/ /data_tmp/
echo "/etc/bind/ backed up 1st time" >> $output
cp -r --parents /var/vmail/ /data_tmp/
echo "/var/vmail/ backed up 1st time" >> $output
cp -r --parents /var/www/ /data_tmp/
echo "/var/www/ backed up 1st time" >> $output
dt=$(date '+%d/%m/%Y %H:%M:%S');
echo "1st Backup Completed $dt" >> $output
echo "1st Backup Completed $dt"
else
echo "Backup log File found. No backup required, change to Persist Data"
fi
11 changes: 10 additions & 1 deletion start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ cd /tmp/ispconfig3_install/install/

if [ -f /usr/local/ispconfig/interface/lib/config.inc.php ];
then
# Fixed: Table already exists
rm /tmp/ispconfig3_install/install/sql/incremental/upd_dev_collection.sql
/wait-for-it.sh $isp_mysql_hostname:$isp_mysql_port -- php -q update.php --autoinstall=/tmp/ispconfig3_install/install/autoinstall.ini
else
/wait-for-it.sh $isp_mysql_hostname:$isp_mysql_port -- php -q install.php --autoinstall=/tmp/ispconfig3_install/install/autoinstall.ini
Expand Down Expand Up @@ -79,4 +81,11 @@ chown root:bind /etc/bind/rndc.key
# fix index permission error
chown courier: /etc/courier/shared/index

/usr/bin/supervisord -c /etc/supervisor/supervisord.conf
if [ -f "/var/backup/1st-backup-complete.log" ];
then
echo "1st Backup file exists. Nothing to do here"
else
/do-1st-backup.sh &
fi

/usr/bin/supervisord -c /etc/supervisor/supervisord.conf