Skip to content
Snippets Groups Projects

Ajout de backup.sh

Merged Elian Loraux requested to merge services-desk-183-backup into main

Ajout de backup.sh pour sauvegarder au format tar.gz dans le dossier backups la base de donnée et la configuration keycloak

Je ne sauvegarde pas les thèmes custom qui théoriquement sont gité.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • David Beniamine
  • backup.sh 0 → 100644
    1 #!/bin/bash
    2
    3 echo "Backing up Keycloak DB and config"
    4
    5 if [ ! -d "backups" ]; then
    6 echo "backups does exist. Create this."
  • Évite les echo quand tout vas bien, et utilise des variables pour éviter la duplication de code.

    Pense aussi a protéger les variables qui peuvent contenir des caractère foireux ...

  • David Beniamine left review comments

    left review comments

  • Elian Loraux added 1 commit

    added 1 commit

    • ace8a1e8 - Remove echo and add variable docker_compose

    Compare with previous version

  • Elian Loraux added 1 commit

    added 1 commit

    • d6ea575f - Protect MariaDB Pass variable

    Compare with previous version

  • Elian Loraux requested review from @dbeniamine

    requested review from @dbeniamine

  • Author Maintainer

    @dbeniamine modification faites, dit moi si tout est bon

  • David Beniamine
  • backup.sh 0 → 100644
    1 #!/bin/bash
    2
    3 echo "Backing up Keycloak DB and config"
    4
    5 if [ -z "$MARIADB_PASS" ]; then
    6 echo "Error: the MARIADB_PASS variable is not set or is empty."
    7 exit 1
    8 fi
    9
    10 if [ ! -d "backups" ]; then
    11 mkdir "backups"
    12 fi
  • backup.sh 0 → 100644
    1 #!/bin/bash
    2
    3 echo "Backing up Keycloak DB and config"
    4
    5 if [ -z "$MARIADB_PASS" ]; then
    6 echo "Error: the MARIADB_PASS variable is not set or is empty."
    7 exit 1
    8 fi
    9
    10 if [ ! -d "backups" ]; then
    11 mkdir "backups"
    12 fi
    13
    14 out="backups/keycloak_$(date +%Y%m%d_%H%M).tar.gz"
  • David Beniamine left review comments

    left review comments

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading