Bash script not working to delete logs


#21

Then either correct it for ‘google programmers’ or run it manually until you figure it out


#22

lol…You’re the best part of this forum, dicko.


(Mitch Mitchell) #23

Instead of trying to write a custom script to prune your log files, check out the logrotate command. It is usually run from cron in the cron.daily directory on most linux systems I’ve seen. It is specifically designed for this sort of thing and certainly has more error handling and such than your script has. “man logrotate” will give you information about how to modify the configuration file to prune the logs you are wanting to remove.

You will find some examples for asterisk in /etc/logrotate.d


(system) closed #24

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.