fixes on postinstall & backup script
This commit is contained in:
parent
5154afd918
commit
5e6d32699d
3 changed files with 3 additions and 5 deletions
|
@ -12,7 +12,7 @@ function get_backup_date () {
|
||||||
}
|
}
|
||||||
|
|
||||||
function delete_old_backups () {
|
function delete_old_backups () {
|
||||||
find ${BACKUP_DIR}/*_zammad_*.gz -maxdepth 2 -mindepth 2 -type f -mtime +${HOLD_DAYS} -exec rm -r \;
|
find ${BACKUP_DIR}/*_zammad_*.gz -type f -mtime +${HOLD_DAYS} -exec rm -r \;
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_db_credentials () {
|
function get_db_credentials () {
|
||||||
|
@ -43,7 +43,7 @@ function backup_db () {
|
||||||
mysqldump --opt --single-transaction ${DB_NAME} | gzip > ${BACKUP_DIR}/${TIMESTAMP}_zammad_db.mysql.gz
|
mysqldump --opt --single-transaction ${DB_NAME} | gzip > ${BACKUP_DIR}/${TIMESTAMP}_zammad_db.mysql.gz
|
||||||
elif [ "${DB_ADAPTER}" == "postgresql" ]; then
|
elif [ "${DB_ADAPTER}" == "postgresql" ]; then
|
||||||
su -c "pg_dump ${DB_NAME} | gzip > ${BACKUP_DIR}/${TIMESTAMP}_zammad_db.psql.gz" postgres
|
su -c "pg_dump ${DB_NAME} | gzip > ${BACKUP_DIR}/${TIMESTAMP}_zammad_db.psql.gz" postgres
|
||||||
else
|
else
|
||||||
echo "ADAPTER not found. if its sqlite backup is already saved in filebackup"
|
echo "ADAPTER not found. if its sqlite backup is already saved in filebackup"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@ delete_old_backups
|
||||||
if [ -f ${ZAMMAD_DIR}/${DATABASE_CONFIG} ]; then
|
if [ -f ${ZAMMAD_DIR}/${DATABASE_CONFIG} ]; then
|
||||||
get_db_credentials
|
get_db_credentials
|
||||||
else
|
else
|
||||||
echo "${ZAMMAD_DIR}//${DATABASE_CONFIG} is missing. is zammad configured yet?"
|
echo "${ZAMMAD_DIR}/${DATABASE_CONFIG} is missing. is zammad configured yet?"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -228,5 +228,3 @@ function final_message () {
|
||||||
fi
|
fi
|
||||||
echo -e "####################################################################################"
|
echo -e "####################################################################################"
|
||||||
}
|
}
|
||||||
|
|
||||||
function
|
|
Loading…
Reference in a new issue