Glaanieboy
OSNN Veteran Addict
- Joined
- 6 Mar 2002
- Messages
- 2,628
I want to create a script (along with a daily/weekly cronjob), that does the following to the httpd (apache) logs:
Btw, I created a part of the script, which is like:
Thanks
- Rename the logs
- Create a new, empty log file by using touch <filename>
- Move the backup file to a directory, for example a dir in my own home dir
Btw, I created a part of the script, which is like:
Code:
cd /var/log/httpd
;**This is where I want the dynamic extension. In this example
;**I used .bck at the end of the filename,
;**but I want this to be dynamic.
mv httpd-access.log /path/to/archive/httpd-access.log.bck && touch httpd-access.log
mv httpd-error.log /path/to/archive/httpd-error.log.bck && touch httpd-error.log
Thanks