|
script to rename files with current date and copy it.
I have few webservers logs like access.log. which would be growing everyday.
what i do everyday is, take the backup of access.log as access.log_(currentdate) and nullify the access.log.
So thought of writing a script... but stuck up in middle.
My requirement: to take the backup and nullify the log after it reaches 500 mb
1) i am able to find the logs which are more than 500mb using this command
find . -size +1000000 -exec ls -l {} \; > /tmp/logs
2) How do i pickup the files mentioned in /tmp/logs and take the backup with currentdate ? i need a command to backup (copy) with current date in same directory .
Thanks
logic0
|