ArticlesReader.com Menu
Newest Articles
Most Viewed Articles
ArticlesReader.com RSS
Submit Article
Login
Signup
Search the articles

Articles Main Categories
Advice
Animals
Automobiles
Business
Career
Communications
Computer Programming
Computers
Entertainment
Environment
Family
Fashion
Finance
Food
Health & Medical
Home & Garden
Humor
Internet Business
Internet Marketing
Legal
Leisure & Recreation
Marketing
Other
Politics
Reference & Education
Religion
Self Improvement
Sports
Technology & Science
Travel
Writing
Subscribe
Receive alert message from us when new articles submitted to our site for free.

Enter your name

Enter your email

Syndicate

















Related Products
Home::Software

Log File UNIX Commands

Author : Atlas-Tuesday
One of the biggest parts of my job is managing website log files. Our business is very “marketing-centric”, so missing log file data isn’t expectable. There have been a few situations were log files have been split or broken. Below are three nice little commands which have helped tremendously.



Removes all log files with no data

find /home/httpd/logs -size 0 -type f -print0 | xargs -0 rm –f

This is a simple little command which helps keep things neat and organized. Once files rotate IÂ’ve found a bunch of empty files on the folder. This really confuses some of the marketing people.



Converts log files extention into logical month.

for i in `dir /home/httpd/logs/*-access_log.1|sed s/\.1$//`; do mv $i.1 $i.feb; done

A little more complicated. Again, the overall goal here is to make the log files more friendly for marketing people connecting into the FTP server. I am converting the *.1 extension file created by the log rotate into *.month. I use this single line to change the extension on 300+ files. Works fantastic!



Combines log files with extentions .1.1 -> .1 and creates a new logical month.

for i in `dir /home/httpd/logs/*-access_log.1|sed s/\.1$//`; do cat $i.1.1 $i.1 >$i.mar; done

Here is the big daddy. One month because of a mistake the log files rotated mid-month. This would have been a nightmare to manually concatenate each file. This script above takes the files and combines them. Try to do this in windows!



For the most part IÂ’ve learned to hate access logs. They are a big, always changes, difficult to backup, and from a technical perspective somewhat useless. These little few commands above however make life a little easier.


Article Source: http://www.articledashboard.com





Atlas-Tuesday - Log File UNIX Commands





Spam emails More free articles

Related articles


  1. Scrap Booking Online: Word Perfect or Corel Graphics Suite?
  2. Great Plains Dexterity Customization Options – Overview For Developers
  3. Microsoft Great Plains Security Setup - Overview For Consultant
  4. Microsoft Great Plains Implementation: Collection Management – Overview For Consultant
  5. Best Spyware Removers
  6. Monitoring Software Can be Used for Spying as Well
  7. Beware of Spyware
  8. Microsoft CRM Integration & Customization: SharePoint Document Gateway
  9. Adware, What Is It?
  10. Microsoft CRM Modification – Overview for IT Specialist
  11. Reporting Tools for Microsoft Great Plains – Overview For Developers
  12. Microsoft Great Plains Upgrade – Things to Consider and FAQ
  13. Great Plains Dexterity History and Programming Overview
  14. Microsoft Great Plains on Ctree or Pervasive SQL – What to Do – Tips for IT Manager
  15. Microsoft Business Solutions VAR/Partner Selection – Overview for IT Director/Manager/Controller
  16. Great Plains Accounting Migration to Microsoft Great Plains - Overview for IT Specialist
  17. Microsoft Great Plains Data Conversion – Overview For Developer
  18. Great Plains Dynamics/eEnterprise Upgrade – Things to Consider and FAQ
  19. Crystal Reports - Geterogeneus databases: SQL Server, Oracle, Unidata, Btrieve – Tips For Developer
  20. Great Plains Dexterity Programming – Overview For Developer
  21. Great Plains Custom Development: Dexterity, VBA, SQL, Crystal, eConnect – Overview For Programmer
  22. How To Create A Data Capture Procedure Checklist For Your Small Business CRM Software
  23. Chinese Input - Step by Step Instruction on How to Input Chinese Characters in English Windows XP
  24. Microsoft Great Plains - Payroll & HR Inexpensive Solution? Not Any More
  25. 20 Extra Hours Per Week: What Would You Do?
More related feeds
Custom Log File Revisited
I’m always up for increasing the UNIX skills, so I took on this challenge. After several hours of research and tweaking, I’ve got a solution that works nicely. Hardcore command line geeks can start laughing here—for those in the know, ...

RE: New Appender: PatternFileAppender
LOGFILE.forceRollTime=03:00 log4j.appender.LOGFILE.zipAfterDays=1 log4j.appender.LOGFILE.disposeAfterDays=6 Note: My appender does not limit the number of concurrent open files. May I ask what is the limit in Unix/Linux if anyone knows? ...

Rescheduling perl script using at command
My requirement is, if the input file is not available then reschedule the script after 30 minutes.I tried to implement this logic using 'at' command by including the below statement in the script : ...

List Installed Packages on Your Ubuntu Linux
While managing software packages, it stores all the files it depends upon in a /var/lib/dpkg directory. Most of these files you can look into using basic Unix commands, but there's really no need because dpkg does it for you. ...

Manual Testing of Terracotta Clustering
2 Server was shutdown using the Unix kill -9 pid command 3 Either no JAVA_OPTS flags were used, or the sakai.cluster.terracotta flag was set to false 4 The sakai.cluster.terracotta JAVA_OPT was used and set to true along with the other ...

What's good about 11.50.xC2
One usability issue with the Config Wizard on Windows in xC1 was that the onconfig file it would generate would have some UNIX specific values for parameters such as for Java stored procedures (JVPJAVAVM etc) which would mean extra work ...

URGENT-Jobs on AIX executes but does not terminate correctly
11) Days To Retain Log Files. . . . . : [1] 12) Daily Log File Enabled. . . (Y|N): [Y] 13) Timeout for Agent utilities . . . : [30] 14) Locale. . . . . . . . . . . . . . : [] 15) Common Event mechanism. . . . . . : [Y] ...

bash: tips and how-tos (1 of n)
If you find yourself running the same command with a different argument most of the time, you can find this trick useful. user@localhost~$ wget http://file.example.com/file01.log user@localhost~$ wget http://file.example.com/file06.log ...

Top DBA Shell Scripts for Monitoring the Database
UNIX Basics for the DBA. Basic UNIX Command. The following is a list of commonly used Unix command:. ps - Show process; grep - Search files for text patterns; mailx - Read or send mail; cat - Join files or display them ...

ORACLE interview questions(261-280)
Taking backup of archive log files when database is open. For this the ARCHIVELOG mode should be enabled. The following files need to be backed up. All data files. All Archive log, redo log files. All control files. ...

 


 

© 2007 articlesreader.com - All Rights Reserved