2016-12-10 13:48:33 +00:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# zammad backup script
|
|
|
|
#
|
|
|
|
|
|
|
|
PATH=/sbin:/bin:/usr/sbin:/usr/bin:
|
|
|
|
|
|
|
|
# import config
|
|
|
|
. config
|
|
|
|
|
|
|
|
# import functions
|
|
|
|
. functions
|
|
|
|
|
|
|
|
delete_old_backups
|
|
|
|
|
|
|
|
# check if database.yml exists
|
|
|
|
if [ -f ${ZAMMAD_DIR}/${DATABASE_CONFIG} ]; then
|
|
|
|
get_db_credentials
|
|
|
|
else
|
2016-12-11 08:49:57 +00:00
|
|
|
echo "${ZAMMAD_DIR}/${DATABASE_CONFIG} is missing. is zammad configured yet?"
|
2016-12-10 13:48:33 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
get_backup_date
|
|
|
|
|
|
|
|
backup_dir_create
|
|
|
|
|
|
|
|
backup_files
|
|
|
|
|
|
|
|
backup_db
|