diff --git a/sh/local/check_expdp_log.sh b/sh/local/check_expdp_log.sh index 18b7d0b..1eb21c4 100644 --- a/sh/local/check_expdp_log.sh +++ b/sh/local/check_expdp_log.sh @@ -17,5 +17,19 @@ fi # afficher les dernières lignes des fichiers log pour voir les les exports se sont bien déroulés echo "
"; head -10 "{}"; echo ""; tail -10 "{}"; echo ""' \;
+# find "${EXPDP_DIR}" -iname "export_*.log" -exec bash -c 'echo "--- {} ---"; head -10 "{}"; echo ""; tail -10 "{}"; echo ""' \;
+# autre façon d'écrire la commande find : définition de la fonction d'affichage plus lisible
+show_log_excerpt() {
+ local file="$1"
+ echo "--- ${file} ---"
+ echo "" + head -10 "$file" + echo "
" + tail -10 "$file" + echo "" +} +# export pour rendre la fonction accessible à bash -c +export -f show_log_excerpt + +# find appelle la fonction en lui passant $0 comme paramètre +find "${EXPDP_DIR}" -iname "export_*.log" -exec bash -c 'show_log_excerpt "$0"' {} \; \ No newline at end of file