provisioning tool for building opinionated architecture
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

122 lines
3.8 KiB

10 months ago
  1. # ===============================
  2. # === Debian specific options ===
  3. #================================
  4. # By default, on Debian systems, only 'postgres' user
  5. # is allowed to access PostgreSQL databases without password.
  6. # In order to dump databases we need to run pg_dump/psql
  7. # commands as 'postgres' with su.
  8. #
  9. # The following setting has been added to workraound this issue.
  10. # (if it is set to empty, 'su' usage will be disabled)
  11. SU_USERNAME=postgres
  12. #=====================================================================
  13. # Set the following variables to your system needs
  14. # (Detailed instructions below variables)
  15. #=====================================================================
  16. # Username to access the PostgreSQL server e.g. dbuser
  17. USERNAME=postgres
  18. # Password
  19. # create a file $HOME/.pgpass containing a line like this
  20. # hostname:*:*:dbuser:dbpass
  21. # replace hostname with the value of DBHOST and postgres with
  22. # the value of USERNAME
  23. # Host name (or IP address) of PostgreSQL server e.g localhost
  24. DBHOST=localhost
  25. # List of DBNAMES for Daily/Weekly Backup e.g. "DB1 DB2 DB3"
  26. DBNAMES="all"
  27. # pseudo database name used to dump global objects (users, roles, tablespaces)
  28. GLOBALS_OBJECTS="postgres_globals"
  29. # Backup directory location e.g /backups
  30. BACKUPDIR="/mnt/BACKUP/postgresql"
  31. # Mail setup
  32. # What would you like to be mailed to you?
  33. # - log : send only log file
  34. # - files : send log file and sql files as attachments (see docs)
  35. # - stdout : will simply output the log to the screen if run manually.
  36. # - quiet : Only send logs if an error occurs to the MAILADDR.
  37. MAILCONTENT="quiet"
  38. # Set the maximum allowed email size in k. (4000 = approx 5MB email [see docs])
  39. MAXATTSIZE="4000"
  40. # Email Address to send mail to? (user@domain.com)
  41. MAILADDR="root"
  42. # ============================================================
  43. # === ADVANCED OPTIONS ( Read the doc's below for details )===
  44. #=============================================================
  45. # List of DBBNAMES for Monthly Backups.
  46. MDBNAMES="$DBNAMES"
  47. GLOBALS_OBJECTS_INCLUDE="no"
  48. # List of DBNAMES to EXLUCDE if DBNAMES are set to all (must be in " quotes)
  49. DBEXCLUDE="postgres template1"
  50. # Include CREATE DATABASE in backup?
  51. CREATE_DATABASE=yes
  52. # Separate backup directory and file for each DB? (yes or no)
  53. SEPDIR=yes
  54. # Which day do you want weekly backups? (1 to 7 where 1 is Monday)
  55. DOWEEKLY=6
  56. # Choose Compression type. (gzip, bzip2 or xz)
  57. COMP=gzip
  58. # Compress communications between backup server and PostgreSQL server?
  59. # set compression level from 0 to 9 (0 means no compression)
  60. COMMCOMP=0
  61. # Additionally keep a copy of the most recent backup in a seperate directory.
  62. LATEST=no
  63. # OPT string for use with pg_dump ( see man pg_dump )
  64. OPT=""
  65. # Backup files extension
  66. EXT="sql"
  67. # Backup files permissions
  68. PERM=600
  69. # Encyrption settings
  70. # (inspired by http://blog.altudov.com/2010/09/27/using-openssl-for-asymmetric-encryption-of-backups/)
  71. #
  72. # Once the backup done, each SQL dump will be encrypted and the original file
  73. # will be deleted (if encryption was successful).
  74. # It is recommended to backup into a staging directory, and then use the
  75. # POSTBACKUP script to sync the encrypted files to the desired location.
  76. #
  77. # Encryption uses private/public keys. You can generate the key pairs like the following:
  78. # openssl req -x509 -nodes -days 100000 -newkey rsa:2048 -keyout backup.key -out backup.crt -subj '/'
  79. #
  80. # Decryption:
  81. # openssl smime -decrypt -in backup.sql.gz.enc -binary -inform DEM -inkey backup.key -out backup.sql.gz
  82. # Enable encryption
  83. ENCRYPTION=no
  84. # Encryption public key
  85. ENCRYPTION_PUBLIC_KEY="/etc/ssl/certs/autopostgresqlbackup.crt"
  86. # Encryption Cipher (see enc manpage)
  87. ENCRYPTION_CIPHER="aes256"
  88. # Suffix for encyrpted files
  89. ENCRYPTION_SUFFIX=".enc"
  90. # Command to run before backups (uncomment to use)
  91. #PREBACKUP="/etc/postgresql-backup-pre"
  92. # Command run after backups (uncomment to use)
  93. #POSTBACKUP="/etc/postgresql-backup-post"