I've just read through the hooks documentation.
Stats Functions
Seems that there is everything we could need to do this.
However when cPanel detects that it needs to delete a users log file, it seems that it renames the file then reloads apache.
What we would rearly need is a hook that would allow us to copy the renamed file (either just before the stats are run on it or just before the file is deleted.
It's better than nothing to be able to backup before the logs are deleted but there could still be a few lost entries while our backup is being run (we supposedly could minimise this by doing a hard copy of the file and running the backup on the hardcopy as a background process as to have only a few seconds of lost logs.
Stats Functions
Seems that there is everything we could need to do this.
However when cPanel detects that it needs to delete a users log file, it seems that it renames the file then reloads apache.
What we would rearly need is a hook that would allow us to copy the renamed file (either just before the stats are run on it or just before the file is deleted.
It's better than nothing to be able to backup before the logs are deleted but there could still be a few lost entries while our backup is being run (we supposedly could minimise this by doing a hard copy of the file and running the backup on the hardcopy as a background process as to have only a few seconds of lost logs.