- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: Manage the logs of an application.
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-15-2007 10:31 PM
тАО04-15-2007 10:31 PM
An application on my server generate log files with a specific dimension, ex:
application_log1.txt 10Mb
application_log2.txt 10Mb
application_log3.txt 9Mb
When the dimension reach the limit it overwrite the files.
Now i need to tar the log, and i must to create a script to zip the log when reach the limit, ordered by date.
How i can do this?
Thank you!
Points for all reply.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-15-2007 11:41 PM
тАО04-15-2007 11:41 PM
Re: Manage the logs of an application.
Another options is to use logrotate mechanism: see how other logs are processed in /etc/logrotate.d/*
regards,
ivan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-16-2007 12:15 AM
тАО04-16-2007 12:15 AM
Re: Manage the logs of an application.
Can you give me an example of script?
Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-16-2007 12:53 AM
тАО04-16-2007 12:53 AM
Re: Manage the logs of an application.
tar zcvf application_log-$(date +%m-%d-%Y).tgz application_log*
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-16-2007 12:56 AM
тАО04-16-2007 12:56 AM
Re: Manage the logs of an application.
I'm going to see how logrotate work.
How do you use logrotate in this case?
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-16-2007 01:13 AM
тАО04-16-2007 01:13 AM
Solutionlook at the files in that directory. usually you create a file named after the service/daemon that is creating the log files. Just mimic one of the files in that directory. man logrotate tells more about the options that can be put in the file. here is a sample:
/var/log/application_log?.txt {
rotate 5
weekly
size=10M
compress
postrotate /sbin/killall -HUP
endscript
}
Notice the ? above. You can use globs in choosing the file. Otherwise you create a list like this:
/var/log/application_log1.txt /var/log/application_log2.txt /var/log/application_log3.txt{
rotate 5
weekly
size=10M
compress
postrotate /sbin/killall -HUP
endscript
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-16-2007 02:28 AM
тАО04-16-2007 02:28 AM
Re: Manage the logs of an application.
This week i will try this last solution.
Bye!