functions 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529
  1. #!/usr/bin/env bash
  2. #
  3. # Zammad backup script functions
  4. #
  5. function demand_backup_conf () {
  6. if [ -f "${BACKUP_SCRIPT_PATH}/config" ]; then
  7. # Ensure we're inside of our Backup-Script folder (see issue 2508)
  8. # shellcheck disable=SC2164
  9. cd "${BACKUP_SCRIPT_PATH}"
  10. # import config
  11. . ${BACKUP_SCRIPT_PATH}/config
  12. else
  13. echo -e "\n The 'config' file is missing!"
  14. echo -e " Please copy ${BACKUP_SCRIPT_PATH}/config.dist to ${BACKUP_SCRIPT_PATH}/config before running $0!\n"
  15. echo -e " Learn more about the backup configuration at https://docs.zammad.org/en/latest/appendix/backup-and-restore/configuration.html"
  16. exit 1
  17. fi
  18. # Check if filesystem full dump setting exists and fall back if not
  19. if [ -z ${FULL_FS_DUMP+x} ]; then
  20. # Falling back to old default behavior
  21. FULL_FS_DUMP='yes'
  22. if [ "${DEBUG}" == "yes" ]; then
  23. echo "FULL_FS_DUMP is not set, falling back to 'yes' to produce a full backup."
  24. fi
  25. fi
  26. }
  27. function get_zammad_dir () {
  28. ZAMMAD_DIR="$(echo ${BACKUP_SCRIPT_PATH} | sed -e 's#/contrib/backup.*##g')"
  29. }
  30. function get_backup_date () {
  31. TIMESTAMP="$(date +'%Y%m%d%H%M%S')"
  32. if [ "${DEBUG}" == "yes" ]; then
  33. echo "timestamp is ${TIMESTAMP}"
  34. fi
  35. }
  36. function delete_old_backups () {
  37. # Use -mmin to clean up files as -mtime (days) is too unprecise.
  38. # However, add +60 minutes to allow for the backup script run time, so that
  39. # backups created a few minutes more than a day ago are not already purged.
  40. test -d ${BACKUP_DIR} && find ${BACKUP_DIR}/*_zammad_*.gz -type f -mmin +$(((60*24)*${HOLD_DAYS}+60)) -delete
  41. }
  42. function get_db_credentials () {
  43. DB_ADAPTER="$(grep -m 1 '^[[:space:]]*adapter:' < ${ZAMMAD_DIR}/config/database.yml | sed -e 's/.*adapter:[[:space:]]*//g')"
  44. DB_HOST="$(grep -m 1 '^[[:space:]]*host:' < ${ZAMMAD_DIR}/config/database.yml | sed -e 's/.*host:[[:space:]]*//g')"
  45. DB_PORT="$(grep -m 1 '^[[:space:]]*port:' < ${ZAMMAD_DIR}/config/database.yml | sed -e 's/.*port:[[:space:]]*//g')"
  46. DB_NAME="$(grep -m 1 '^[[:space:]]*database:' < ${ZAMMAD_DIR}/config/database.yml | sed -e 's/.*database:[[:space:]]* //g')"
  47. DB_USER="$(grep -m 1 '^[[:space:]]*username:' < ${ZAMMAD_DIR}/config/database.yml | sed -e 's/.*username:[[:space:]]*//g')"
  48. DB_PASS="$(grep -m 1 '^[[:space:]]*password:' < ${ZAMMAD_DIR}/config/database.yml | sed -e 's/.*password:[[:space:]]*//g')"
  49. if [ "${DB_ADAPTER}" == "postgresql" ]; then
  50. # Ensure that HOST and PORT are not empty, provide defaults if needed.
  51. if [ "${DB_HOST}x" == "x" ]; then
  52. DB_HOST="localhost"
  53. fi
  54. if [ "${DB_PORT}x" == "x" ]; then
  55. DB_PORT="5432"
  56. fi
  57. fi
  58. if [ "${DEBUG}" == "yes" ]; then
  59. echo "adapter=${DB_ADAPTER} dbhost=${DB_HOST} dbport=${DB_PORT} dbname=${DB_NAME} dbuser=${DB_USER} dbpass=${DB_PASS}"
  60. fi
  61. }
  62. function backup_dir_create () {
  63. test -d ${BACKUP_DIR} || mkdir -p ${BACKUP_DIR}
  64. state=$?
  65. if [ "${state}" == "1" ]; then
  66. echo -e "\n\n # ERROR(${state}) - Creation of backup directory failed. Please double check permissions."
  67. echo -e " #-> BACKUP WAS NOT SUCCESSFUL"
  68. exit 3
  69. fi
  70. if [ "${DEBUG}" == "yes" ]; then
  71. echo "backup dir is ${BACKUP_DIR}"
  72. fi
  73. }
  74. backup_file_write_test () {
  75. # We're testing if we can actually write into the provided directory with
  76. # the current user before continuing.
  77. touch ${BACKUP_DIR}/write_test 2> /dev/null
  78. state=$?
  79. if [ "${state}" == "1" ]; then
  80. # We're checking for critical restoration errors
  81. # It may not cover all possible errors which is out of scope of this script
  82. echo -e "\n\n # ERROR(${state}) - Creation of backup files was not possible. Double check permissions."
  83. echo -e " #-> BACKUP WAS NOT SUCCESSFUL"
  84. exit 3
  85. fi
  86. rm -f ${BACKUP_DIR}/write_test
  87. }
  88. backup_file_read_test () {
  89. # We're testing if we can read the provided file names before
  90. # starting. Other wise handling would be more difficult depending on
  91. # the installation type
  92. if [ "${DEBUG}" == "yes" ]; then
  93. echo "I've been looking for these backup files: "
  94. echo "- ${BACKUP_DIR}/${RESTORE_FILE_DATE}_zammad_files.tar.gz"
  95. echo "- ${BACKUP_DIR}/${RESTORE_DB_DATE}_zammad_db.${DB_FILE_EXT}.gz"
  96. fi
  97. if [[ (! -r "${BACKUP_DIR}/${RESTORE_FILE_DATE}_zammad_files.tar.gz") || (! -r "${BACKUP_DIR}/${RESTORE_DB_DATE}_zammad_db.${DB_FILE_EXT}.gz") ]]; then
  98. echo -e "\n\n # ERROR - Cannot read on or more of my backup files. Double check permissions."
  99. echo -e " #-> RESTORE WAS NOT SUCCESSFUL"
  100. exit 3
  101. fi
  102. }
  103. function check_empty_password () {
  104. if [ "${DB_PASS}x" == "x" ]; then
  105. echo "# ERROR - Found an empty database password ..."
  106. echo "# - This may be intended or not, however - this script does not support this."
  107. echo "# - If you don't know how to continue, consult https://docs.zammad.org/en/latest/appendix/backup-and-restore/index.html"
  108. exit 2
  109. fi
  110. }
  111. function backup_files () {
  112. echo "creating file backup..."
  113. if [ "${FULL_FS_DUMP}" == 'yes' ]; then
  114. echo " ... as full dump"
  115. tar -C / -czf ${BACKUP_DIR}/${TIMESTAMP}_zammad_files.tar.gz\
  116. --exclude='tmp' --exclude 'node_modules' --exclude '.git' --exclude='config/database.yml' ${ZAMMAD_DIR#/}
  117. state=$?
  118. else
  119. echo " ... only with productive data (attachments)"
  120. if [ ! -d "${ZAMMAD_DIR}/storage/" ]; then
  121. # Admin has requested an attachment backup only, however, there is no storage
  122. # directory. We'll warn Mr.Admin and create the directory as workaround.
  123. echo " ... WARNING: You don't seem to have any attachments in the file system!"
  124. echo " ... Please consult https://docs.zammad.org/en/latest/appendix/backup-and-restore/troubleshooting.html"
  125. echo " ... Creating empty storage directory so the backup can continue ..."
  126. mkdir -p ${ZAMMAD_DIR}/storage/
  127. chown -R zammad:zammad ${ZAMMAD_DIR}/storage/
  128. fi
  129. tar -C / -czf ${BACKUP_DIR}/${TIMESTAMP}_zammad_files.tar.gz\
  130. ${ZAMMAD_DIR#/}/storage/\
  131. state=$?
  132. fi
  133. if [ $state == '2' ]; then
  134. echo "# ERROR(2) - File backup reported a fatal error."
  135. echo "- Check file permissions and try again."
  136. echo -e " \n# BACKUP WAS NOT SUCCESSFUL"
  137. exit 1
  138. fi
  139. if [ $state == '1' ]; then
  140. echo "# WARNING - Files have changed during backup."
  141. echo "- This indicates your Zammad instance is running and thus may be normal."
  142. fi
  143. ln -sfn ${BACKUP_DIR}/${TIMESTAMP}_zammad_files.tar.gz ${BACKUP_DIR}/latest_zammad_files.tar.gz
  144. }
  145. function create_pgpassfile() {
  146. PGPASSFILE=$(mktemp)
  147. export PGPASSFILE
  148. chmod 600 "$PGPASSFILE"
  149. cat <<EOT > "$PGPASSFILE"
  150. *:*:${DB_NAME}:${DB_USER}:${DB_PASS}
  151. EOT
  152. trap 'rm "$PGPASSFILE"' EXIT
  153. }
  154. function backup_db () {
  155. if [ "${DB_ADAPTER}" == "mysql2" ]; then
  156. echo "creating mysql backup..."
  157. mysqldump --opt --single-transaction -u${DB_USER} -p${DB_PASS} ${DB_NAME} | gzip > ${BACKUP_DIR}/${TIMESTAMP}_zammad_db.mysql.gz
  158. ln -sfn ${BACKUP_DIR}/${TIMESTAMP}_zammad_db.mysql.gz ${BACKUP_DIR}/latest_zammad_db.mysql.gz
  159. elif [ "${DB_ADAPTER}" == "postgresql" ]; then
  160. echo "creating postgresql backup..."
  161. create_pgpassfile
  162. pg_dump --dbname "${DB_NAME}" \
  163. --username "${DB_USER}" \
  164. ${DB_HOST:+--host $DB_HOST} \
  165. ${DB_PORT:+--port $DB_PORT} \
  166. --no-privileges --no-owner \
  167. --compress 6 --file "${BACKUP_DIR}/${TIMESTAMP}_zammad_db.psql.gz"
  168. state=$?
  169. if [ "${state}" == "1" ]; then
  170. # We're checking for critical restoration errors
  171. # It may not cover all possible errors which is out of scope of this script
  172. echo -e "\n\n # ERROR(${state}) - Database credentials are wrong or database server configuration is invalid."
  173. echo -e " #-> BACKUP WAS NOT SUCCESSFUL"
  174. exit 2
  175. fi
  176. ln -sfn ${BACKUP_DIR}/${TIMESTAMP}_zammad_db.psql.gz ${BACKUP_DIR}/latest_zammad_db.psql.gz
  177. else
  178. echo -e "\n\n # ERROR - Database type or database.yml incorrect. Unsupported database type found."
  179. echo -e " #-> BACKUP WAS NOT SUCCESSFUL"
  180. exit 2
  181. fi
  182. }
  183. function backup_chmod_dump_data () {
  184. echo "Ensuring dump permissions ..."
  185. chmod 600 ${BACKUP_DIR}/${TIMESTAMP}_zammad_db.psql.gz ${BACKUP_DIR}/${TIMESTAMP}_zammad_files.tar.gz
  186. }
  187. function check_database_config_exists () {
  188. if [ -f ${ZAMMAD_DIR}/config/database.yml ]; then
  189. get_db_credentials
  190. else
  191. echo -e "${ZAMMAD_DIR}/config/database.yml is missing. is Zammad configured yet? \nAborting..."
  192. exit 1
  193. fi
  194. }
  195. function restore_warning () {
  196. if [ -n "${1}" ]; then
  197. CHOOSE_RESTORE="yes"
  198. else
  199. echo -e "The restore will delete your current database! \nBe sure to have a backup available! \n"
  200. echo -e "Please ensure to have twice the storage of the uncompressed backup size! \n\n"
  201. echo -e "Note that the restoration USUALLY requires root permissions as services are stopped! \n\n"
  202. echo -e "Enter 'yes' if you want to proceed!"
  203. read -p 'Restore?: ' CHOOSE_RESTORE
  204. fi
  205. if [ "${CHOOSE_RESTORE}" != "yes" ]; then
  206. echo "Restore aborted!"
  207. exit 1
  208. fi
  209. }
  210. function db_helper_warning () {
  211. echo -e " # WARNING: THIS SCRIPT CHANGES CREDENTIALS, DO NOT CONTINUE IF YOU DON'T KNOW WHAT YOU'RE DOING! \n\n"
  212. echo -e " Limitations:"
  213. echo -e " - only works for local postgresql installations"
  214. echo -e " - only works for postgresql\n"
  215. echo -e "Enter 'yes' if you want to proceed!"
  216. read -p 'ALTER zammad users password?: ' DB_HELPER
  217. if [ "${DB_HELPER}" != "yes" ]; then
  218. echo "Helper script aborted!"
  219. exit 1
  220. fi
  221. }
  222. function get_restore_dates () {
  223. RESTORE_FILE_DATES="$(find ${BACKUP_DIR} -type f -iname '*_zammad_files.tar.gz' | sed -e "s#${BACKUP_DIR}/##g" -e "s#_zammad_files.tar.gz##g" | sort)"
  224. if [ "${DB_ADAPTER}" == "postgresql" ]; then
  225. DB_FILE_EXT="psql"
  226. elif [ "${DB_ADAPTER}" == "mysql2" ]; then
  227. DB_FILE_EXT="mysql"
  228. fi
  229. RESTORE_DB_DATES="$(find ${BACKUP_DIR} -type f -iname "*_zammad_db.${DB_FILE_EXT}.gz" | sed -e "s#${BACKUP_DIR}/##g" -e "s#_zammad_db.${DB_FILE_EXT}.gz##g" | sort)"
  230. }
  231. function choose_restore_date () {
  232. if [ -n "${1}" ]; then
  233. RESTORE_FILE_DATE="${1}"
  234. else
  235. echo -e "Enter file date to restore: \n${RESTORE_FILE_DATES}"
  236. read -p 'File date: ' RESTORE_FILE_DATE
  237. fi
  238. if [ ! -f "${BACKUP_DIR}/${RESTORE_FILE_DATE}_zammad_files.tar.gz" ];then
  239. echo -e "File ${BACKUP_DIR}/${RESTORE_FILE_DATE}_zammad_files.tar.gz does not exist! \nRestore aborted!"
  240. exit 1
  241. fi
  242. if [ -n "${1}" ]; then
  243. RESTORE_DB_DATE="${1}"
  244. else
  245. echo -e "Enter db date to restore: \n${RESTORE_DB_DATES}"
  246. read -p 'DB date: ' RESTORE_DB_DATE
  247. fi
  248. if [ ! -f "${BACKUP_DIR}/${RESTORE_DB_DATE}_zammad_db.${DB_FILE_EXT}.gz" ];then
  249. echo -e "File ${BACKUP_DIR}/${RESTORE_DB_DATE}_zammad_db.${DB_FILE_EXT}.gz does not exist! \nRestore aborted!"
  250. exit 1
  251. fi
  252. }
  253. function detect_initcmd () {
  254. if [ -n "$(which systemctl 2> /dev/null)" ]; then
  255. INIT_CMD="systemctl"
  256. elif [ -n "$(which initctl 2> /dev/null)" ]; then
  257. INIT_CMD="initctl"
  258. else
  259. function sysvinit () {
  260. service $2 $1
  261. }
  262. INIT_CMD="sysvinit"
  263. fi
  264. if [ "${DOCKER}" == "yes" ]; then
  265. INIT_CMD="initctl"
  266. fi
  267. if [ "${DEBUG}" == "yes" ]; then
  268. echo "INIT CMD = ${INIT_CMD}"
  269. fi
  270. }
  271. function start_zammad () {
  272. echo "# Starting Zammad"
  273. ${INIT_CMD} start zammad
  274. }
  275. function stop_zammad () {
  276. echo "# Stopping Zammad"
  277. ${INIT_CMD} stop zammad
  278. if [ "$?" != "0" ]; then
  279. echo -e "\n\n # WARNING: You don't seem to have administrative permissions!"
  280. echo -e " #-> This may be fine if you're on a source code installation."
  281. echo -e " #-> Please ensure that Zammad is NOT running - otherwise restore will FAIL.\n"
  282. fi
  283. }
  284. function restore_zammad () {
  285. if ! command -v zammad > /dev/null; then
  286. # See #3160 for the reasons of this :>
  287. restore_files
  288. fi
  289. if [ "${DB_ADAPTER}" == "postgresql" ]; then
  290. echo "# Checking requirements"
  291. if ! id "zammad" &> /dev/null; then
  292. echo "# ERROR: User 'zammad' is not present, but should be by default! #"
  293. echo "# Restoration was NOT successful, exiting ..."
  294. exit 1
  295. fi
  296. echo "# ... Dropping current database ${DB_NAME}"
  297. # This step is only needed for some pgsql dumps, as they don't provide a drop table statement which will cause
  298. # relation errors during restoration (as on package installation there's always an initialized database)
  299. if command -v zammad > /dev/null; then
  300. zammad config:set DISABLE_DATABASE_ENVIRONMENT_CHECK=1
  301. zammad run rake db:drop
  302. zammad config:set DISABLE_DATABASE_ENVIRONMENT_CHECK=0
  303. else
  304. DISABLE_DATABASE_ENVIRONMENT_CHECK=1 ${ZAMMAD_DIR}/bin/rake db:drop
  305. fi
  306. echo "# ... Creating database ${DB_NAME} for owner ${DB_USER}"
  307. if command -v zammad > /dev/null; then
  308. # We'll skip this part for docker installations
  309. su -c "psql -c \"CREATE DATABASE ${DB_NAME} OWNER ${DB_USER};\"" postgres
  310. else
  311. ${ZAMMAD_DIR}/bin/rake db:create
  312. fi
  313. echo "# Restoring PostgreSQL DB"
  314. create_pgpassfile
  315. # We're removing uncritical dump information that caused "ugly" error
  316. # messages on older script versions. These could safely be ignored.
  317. zcat ${BACKUP_DIR}/${RESTORE_DB_DATE}_zammad_db.${DB_FILE_EXT}.gz | \
  318. sed '/^CREATE EXTENSION IF NOT EXISTS plpgsql/d'| \
  319. sed '/^COMMENT ON EXTENSION plpgsql/d'| \
  320. psql -q -b -o /dev/null \
  321. ${DB_HOST:+--host $DB_HOST} ${DB_PORT:+--port $DB_PORT} ${DB_USER:+--username $DB_USER} --dbname ${DB_NAME}
  322. state=$?
  323. if [[ ("${state}" == "1") || ( "${state}" == "2") || ( "${state}" == "3") ]]; then
  324. # We're checking for critical restoration errors
  325. # It may not cover all possible errors which is out of scope of this script
  326. echo -e "\n\n # ERROR(${state}) - Database credentials are wrong or database server configuration is invalid."
  327. echo -e " #-> RESTORE WAS NOT SUCCESSFUL"
  328. exit 2
  329. fi
  330. elif [ "${DB_ADAPTER}" == "mysql2" ]; then
  331. echo "# Restoring MySQL DB"
  332. zcat < ${BACKUP_DIR}/${RESTORE_DB_DATE}_zammad_db.${DB_FILE_EXT}.gz | mysql -u${DB_USER} -p${DB_PASS} ${DB_NAME}
  333. state=$?
  334. if [ "${state}" != "0" ]; then
  335. echo -e "\n\n # ERROR(${state}) - Database credentials are wrong or database server configuration is invalid."
  336. echo -e " #-> RESTORE WAS NOT SUCCESSFUL"
  337. exit 2
  338. fi
  339. else
  340. echo -e "\n\n # ERROR - Database type or database.yml incorrect. Unsupported database type found."
  341. echo -e " #-> RESTORE WAS NOT SUCCESSFUL"
  342. exit 2
  343. fi
  344. if command -v zammad > /dev/null; then
  345. # See #3160 for the reasons of this :>
  346. restore_files
  347. fi
  348. # Ensure all data is loaded from the restored database and not the cache of the previous system state
  349. echo "# Clearing Cache ..."
  350. if command -v zammad > /dev/null; then
  351. zammad run rails r "Cache.clear"
  352. else
  353. ${ZAMMAD_DIR}/bin/rails r "Cache.clear"
  354. fi
  355. }
  356. function restore_files () {
  357. echo "# Restoring Files"
  358. tar -C / --overwrite -xzf ${BACKUP_DIR}/${RESTORE_FILE_DATE}_zammad_files.tar.gz
  359. state=$?
  360. if [[ ($state == '1') || ($state == '2') ]]; then
  361. echo "# ERROR(${state}) - File restore reported an error."
  362. echo "- Check file permissions, and ensure Zammad IS NOT running, and try again."
  363. echo -e " \n# RESTORE WAS NOT SUCCESSFUL"
  364. exit 1
  365. fi
  366. echo "# Ensuring correct file permissions ..."
  367. chown -R zammad:zammad ${ZAMMAD_DIR}
  368. }
  369. function kind_exit () {
  370. # We're nice to our admin and bring Zammad back up before exiting
  371. start_zammad
  372. exit 1
  373. }
  374. function db_helper_alter_user () {
  375. # Get DB credentials
  376. get_db_credentials
  377. if [ "${DB_PASS}x" == "x" ]; then
  378. echo "# Found an empty password - I'll be fixing this for you ..."
  379. DB_PASS="$(tr -dc A-Za-z0-9 < /dev/urandom | head -c10)"
  380. sed -e "s/.*adapter:.*/ adapter: ${DB_ADAPTER}/" \
  381. -e "s/.*username:.*/ username: ${DB_USER}/" \
  382. -e "s/.*password:.*/ password: ${DB_PASS}/" \
  383. -e "s/.*database:.*/ database: ${DB_NAME}/" < ${ZAMMAD_DIR}/contrib/packager.io/database.yml.pkgr > ${ZAMMAD_DIR}/config/database.yml
  384. echo "# ... Fixing permission database.yml"
  385. chown zammad:zammad ${ZAMMAD_DIR}/config/database.yml
  386. fi
  387. if [ "${DB_USER}x" == "x" ]; then
  388. echo "ERROR - Your configuration file does not seem to contain a username."
  389. echo "Aborting the script - double check your installation."
  390. kind_exit
  391. fi
  392. if [ "${DB_ADAPTER}" == "postgresql" ]; then
  393. if [[ ("${DB_HOST}" == "localhost") || "${DB_HOST}" == "127.0.0.1" || "${DB_HOST}" == "::1" ]]; then
  394. # Looks like a local pgsql installation - let's continue
  395. su -c "psql -c \"ALTER USER ${DB_USER} WITH PASSWORD '${DB_PASS}';\"" postgres
  396. state=$?
  397. else
  398. echo "You don't seem to be using a local PostgreSQL installation."
  399. echo "This script does not support your installation. No changes were done."
  400. kind_exit
  401. fi
  402. else
  403. echo "You don't seem to use PostgreSQL. This script does not support your installation."
  404. echo "No changes were done."
  405. kind_exit
  406. fi
  407. if [ "${state}" != "0" ]; then
  408. echo "ERROR - Our previous command returned an unhandled error code."
  409. echo "Check above command output. Please consult https://community.zammad.org if you can't solve this issue on your own."
  410. kind_exit
  411. fi
  412. }
  413. function start_backup_message () {
  414. echo -e "\n# Zammad backup started - $(date)!\n"
  415. }
  416. function start_restore_message () {
  417. echo -e "\n# Zammad restore started - $(date)!\n"
  418. }
  419. function start_helper_message () {
  420. echo -e "\n # This helper script sets the current Zammad user password on your postgresql server."
  421. }
  422. function finished_backup_message () {
  423. echo -e "\n# Zammad backuped successfully - $(date)!\n"
  424. }
  425. function finished_restore_message () {
  426. echo -e "\n# Zammad restored successfully - $(date)!\n"
  427. }