Answer the question
In order to leave comments, you need to log in
Removing old directories from FreePBX?
Good afternoon everyone, I ask for your help. For himself sooo little familiar with * nix.
There are several scripts on the Freepbx server, in short:
The first script cleans the database of old CDR records
The second one cleans the *.wav files themselves in the /var/spool/asterisk/monitor/%year%/%month%/day% folders
Now to the point , what to add to the script so
that it also cleans the empty folders themselves older than 91 days? records:
find /var/spool/asterisk/monitor/ -name "*.*" -type f -mtime +91 -print -delete >> /etc/asterisk/scripts/delrecord.log
Answer the question
In order to leave comments, you need to log in
find /var/spool/asterisk/monitor/ -type d -empty -exec rmdir {} \; # Удаляем пустые диры
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question