How do I use a cronjob to truncate all logs on my Centos 7 server to 1 gig max size?
I am running a VPS with centos 7 and have several websites sites hosted on it (wordpress, magento, joomla, opencart, corephp). I am looking for a way (cronjob if possible) that can truncate the various error.log and other log files of these sites to a max size of 1 gb each. I am imagining a script that can search for .log files on the server and truncate them at a fixed interval, if it is possible to create such a cronjob (using logrotate?). If not I don't mind setting one cronjob per error.log or whatever.log file if someone here could help me create the cronjob query that can do it.