je veux la changer sur mon script. Voila le script que j'exécute en ce moment:
# tester si les enregistrement ont atteint la durée de vie maximale (1 an)
nb_records=$(find /root/Jflow -maxdepth 1 -mindepth 1 -type d | wc -l)
if [ "$nb_records" == "12" ]
then rm -fr /root/Jflow/*
fi
# récupérer le mois courrant
current_month=$(date +%B)
# récupérer la date courrante
current_date=$(date +%d-%m-%Y)
# si un répertoire nommé après cette date existe alors lancer nfdump avec /root/Jflow/$current_month/$current_date comme
# répertoire cible
if [ -d "/root/Jflow/$current_month/$current_date" ]
then nfcapd -D -p 2055 -l /root/Jflow/$current_month/$current_date
# sinon créer le répertoire puis lancer nfdump
else
mkdir -p /root/Jflow/$current_month/$current_date
nfcapd -D -p 2055 -l /root/Jflow/$current_month/$current_date
fi
comment je fais pour que le script change de répertoire quand il atteint 24h depuis qu'il a été lancé puis lorsqu'il atteint un mois???