From 8b7a434fe687046a5b423ba566fa5aa4a9a6fb0e Mon Sep 17 00:00:00 2001 From: Yacine31 Date: Fri, 2 Aug 2024 14:41:12 +0200 Subject: [PATCH] Update backup_bin.sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit exclusion des répertoires audit, diag et admin --- backup_bin.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/backup_bin.sh b/backup_bin.sh index 26a8a39..306d6e3 100755 --- a/backup_bin.sh +++ b/backup_bin.sh @@ -34,8 +34,15 @@ install -d ${BKP_APP_LOCATION} # sauvegarde #------------------------------------------------------------------------------ -# compression du repertoire oracle app cd ${BKP_APP_LOCATION} +# suppression des anciennes sauvegardes rm -fv backup_bin_oraapp_*.tgz -sudo tar cfz backup_bin_oraapp_$(date +%Y%m%d).tgz ${ORA_APP_LOCATION} && curl -d "$(hostname) - backup des binaires terminée" ${NTFY_URL} +# compression du repertoire oracle app avec exclusion des répertoires admin, diag et audit +sudo tar --exclude='${ORA_APP_LOCATION}/oracle/admin' \ +--exclude='${ORA_APP_LOCATION}/oracle/audit' \ +--exclude='${ORA_APP_LOCATION}/oracle/diag' \ +cfz backup_bin_oraapp_$(date +%Y%m%d).tgz ${ORA_APP_LOCATION} + +# notification +curl -d "$(hostname) - backup des binaires terminée" ${NTFY_URL}