Shell Script or Command to Remove PDF file from large logs
Hi,
I need to remove a large binary file(PDF file) from a large log file which is generated daily.This is seriously hogging space on our servers.I need to remove the large PDF from the logs to make the logs smaller and manageable I need to take out the texts (or binary file) between the strings <my:PDF> and </my:PDF> <applicationForm> and </applicationForm> <image> and </image> <extractedSignature> and </extractedSignature> I am not sure whether sed utility can do this, these are large files and need to be pruned .I am not seeking logrotation advice just a script or command that can strip these large logs of texts between the characters above . I am not sure how to do this.These files are rather large.I am not sure how to achieve this with sed , tail, head , tr or any other facility . Your help would be greatly appreciated. |
You can try:
Code:
sed '/<applicationForm>/,/<\/applicationForm>/d' file.log |
Colucix, Thanks a million i tried this and it works it ruduced the file size drastically..i really appreciate your help.have a good day
|
All times are GMT -5. The time now is 02:14 AM. |