[ASK] Delete error log

jaran

New member
Is there anyone knowing php script how to delete error log via cron job or manually ? I really need it now. Thanks.
 

jaran

New member
@Sander
Because I want to delete it every week without login cpanel. Some rewrite url of my site need to fix it I though.

@id
LOL :p

@Genesis
Thanks. I will check it now.
 

un4saken

Administrator
Actually is it very easy.

PHP:
<?php
unlink('error_log');
?>

name it errorlog-delete.php or something like that, and run it every hour by a cronjob. I use this code too.
 

Genesis

Administrator
Staff member
I just knew you would come up with something short and simple. Brilliant as per usual! :cool: :drinks:
 

jaran

New member
un4saken said:
Actually is it very easy.

PHP:
<?php
unlink('error_log');
?>

name it errorlog-delete.php or something like that, and run it every hour by a cronjob. I use this code too.

Thanks un4saken. It looks simply than I though. But is this working for global or per folder ?
 

un4saken

Administrator
It works only within its directory. If you want to delete another file in a sub directory just move the .php file there too and run it.
 

jaran

New member
un4saken said:
It works only within its directory. If you want to delete another file in a sub directory just move the .php file there too and run it.
Thank you un4. It really help me alot. :good:
 

ogah

New member
un4saken said:
Actually is it very easy.

PHP:
<?php
unlink('error_log');
?>

name it errorlog-delete.php or something like that, and run it every hour by a cronjob. I use this code too.

or put in index.php so error_log will deleted each visitor open your webpage :)
 

jaran

New member
ogah said:
un4saken said:
Actually is it very easy.

PHP:
<?php
unlink('error_log');
?>

name it errorlog-delete.php or something like that, and run it every hour by a cronjob. I use this code too.

or put in index.php so error_log will deleted each visitor open your webpage :)
Good idea too. Thanks.