Sous Linux
#!/bin/bash
cd /exploit/logs
find *.e -type f -not -empty
Sous Windows
rem ——————————————– rem ce script rechercher les fichiers non vide rem pour un type (extension) donné rem dans une directorie donné rem ——————————————–
@Echo Off
echo extension : %1 echo dossier : %2
setlocal ENABLEDELAYEDEXPANSION
set /A P1=0 set fic=%1 set dossier=%2
for /R %dossier% %%i in (%fic%) do if « %%~zi » geq « 1 » ( echo %%~nxzi set /A P1=!P1!+1 )
echo Il y a !P1! fichiers non vide
set /A nb_fic=!P1!
if %nb_fic% equ 0 goto TERMINE goto ERREUR
:ERREUR Echo « il y a !P1! Pb sur ces serveurs » rem cd %ABM_LOGS% rem copy /Y %TOM_LOG_PATH_E% log_erreur.txt rem copy /Y %TOM_LOG_PATH_O% log_standard.txt rem %ABM_BIN%/tmail -c %ABM_BIN%/tmail.ini -to eric.fougere@faiveleytransport.com -sub « DCB – VTOM : ERREUR job : %TOM_JOB% » -msg « fichier log non vide MACHINE : %TOM_HOST% %TOM_JOB% : Les log errors ne sont pas vides. » -att log_standard.txt;log_erreur.txt
:TERMINE exit /b %nb_fic%