- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- arhive script help.
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
Forums
Discussions
Discussions
Discussions
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
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
01-23-2006 07:14 AM
01-23-2006 07:14 AM
arhive script help.
ls -l
-rw-r--r-- 1 postgres postgres 120859203 Jan 15 23:59 postgresql-2006-01-15_000000.log
-rw-r--r-- 1 postgres postgres 940274970 Jan 16 23:58 postgresql-2006-01-16_000000.log
-rw-r--r-- 1 postgres postgres 976725601 Jan 17 23:59 postgresql-2006-01-17_000000.log
-rw-r--r-- 1 postgres postgres 970093678 Jan 18 23:59 postgresql-2006-01-18_000000.log
-rw-r--r-- 1 postgres postgres 858010447 Jan 19 23:59 postgresql-2006-01-19_000000.log
-rw------- 1 postgres postgres 912979525 Jan 20 18:36 postgresql-2006-01-20_000000.log
-rw------- 1 postgres postgres 49227396 Jan 21 00:00 postgresql-2006-01-20_183708.log
-rw------- 1 postgres postgres 142989912 Jan 21 23:59 postgresql-2006-01-21_000000.log
-rw------- 1 postgres postgres 202722648 Jan 22 23:59 postgresql-2006-01-22_000000.log
-rw------- 1 postgres postgres 749064835 Jan 23 12:12 postgresql-2006-01-23_000000.log
find /var/log/pgsql/* -type f -mtime +5 gzip {} \;
Looks like this will work but it also touches the file currently in use..so now..
I only need to select the *.logs created in the last 7 days and gzip them into a single archive for the week.
MY goal here is archive everything except the file currently in use / being written to.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2006 07:39 AM
01-23-2006 07:39 AM
Re: arhive script help.
You can actually download a tool that does it for you. Its called logrotate.
http://hpux.connect.org.uk/hppd/hpux/Sysadmin/logrotate-2.5/
It hasn't been updated in a while but it works very nicely. Its configurable to any log name or location.
Just like Linux.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2006 07:40 AM
01-23-2006 07:40 AM
Re: arhive script help.
find /var/log/pgsql -type f -name "*.log" -mtime +5 -exec gzip {} \;
should do it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2006 07:47 AM
01-23-2006 07:47 AM
Re: arhive script help.
Thought I was posting to hpux.
logrotate is built into Linux
rpm -qa | grep logrotate
chkconfig logroate on
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2006 08:05 AM
01-23-2006 08:05 AM
Re: arhive script help.
But 'logrotate' is designed to do the rotation for you, but it looks like Postgre is doing that, so.. I'm not sure if you can get it to just compress the logs..
Worth looking into though ;)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2006 04:52 AM
01-24-2006 04:52 AM