jeudi 8 novembre 2018

How can I delete error logs with a cronjob?

I want to delete the error_log file using a cronjob every 2 days, this is my first time using cronjobs, and I want to be sure on what im doing, so this is what i got:

find /a/b/error_log.txt -mtime +2 -exec rm {} \; #Delete error_log file every 2 days

I don't know if im specifying the file correctly or if my command is wrong,

Any help will be appreciated :)!




Aucun commentaire:

Enregistrer un commentaire