LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris and OpenSolaris.
General Sun, SunOS and Sparc related questions also go here.

Notices

Reply
 
Thread Tools
Old 03-25-2007, 07:56 PM   #1
keysorsoze
Member
 
Registered: Apr 2004
Location: Queens, NY
Distribution: Red Hat, Solaris
Posts: 292
Thanked: 0
Zcat broken?


[Log in to get rid of this advertisement]
Hi! I just configured my Solaris 10 machine to use logadm with compression for logs.

Here is an example of rotation for the message_log.

/opt/pmx/var/log/message_log -C 90 -P 'Sun Mar 25 03:59:00 2007' -p now -z 0

My issue is now that they are rotating I cannot cat them with zcat. Here is the following error that I get it does not see the compressed logs.

[root@localhost /opt/pmx/var/log]# ls
blocklist_log manager pmx_err.1.gz pmx_out ppm_log.2.gz resources_log.0.gz
blocklist_log.0.gz message_log pmx_err.2.gz pmx_out.0.gz ppm_log.3.gz resources_log.1.gz
blocklist_log.1.gz message_log.0.gz pmx_err.3.gz pmx_out.1.gz proserv_failover_log resources_log.2.gz
blocklist_log.2.gz message_log.1.gz pmx_log pmx_out.2.gz proserv_failover_log.0.gz resources_log.3.gz
blocklist_log.3.gz message_log.2.gz pmx_log.0.gz pmx_out.3.gz proserv_failover_log.1.gz rpc
csl_log message_log.3.gz pmx_log.1.gz ppm_log proserv_failover_log.2.gz snapshot_log
csl_pending_alerts pmx_err pmx_log.2.gz ppm_log.0.gz proserv_failover_log.3.gz
install_log pmx_err.0.gz pmx_log.3.gz ppm_log.1.gz resources_log
[root@localhost /opt/pmx/var/log]# zcat message_log.3.gz
message_log.3.gz.Z: No such file or directory
[root@localhost /opt/pmx/var/log]#

As we can see I cannot cat a compressed file it is as if it doesn't even exist. I tried zcat on a Red Hat machine and it works fine on .gz compressed logs.

Can anyone input some advice as to what I am doing wrong

Thanks.
keysorsoze is offline     Reply With Quote
Old 03-26-2007, 12:22 AM   #2
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris, under a rock ...
Distribution: Solaris & OpenSolaris based distros, Ubuntu
Posts: 8,134
Thanked: 86
zcat is to be used on files created with "compress", i.e. files with a ".Z" extension.

What you want is to view files created with gzip (".gz" extension), which is done with the "gzcat" command.
jlliagre is offline     Reply With Quote
Old 03-27-2007, 10:17 PM   #3
keysorsoze
Member
 
Registered: Apr 2004
Location: Queens, NY
Distribution: Red Hat, Solaris
Posts: 292
Thanked: 0

Original Poster
Thanks for the reply, gzcat worked perfectly. Its odd because in Red Hat I use zcat on .gz files and it works fine. Guess its the Solaris way of doing things.
keysorsoze is offline     Reply With Quote
Old 03-28-2007, 02:01 AM   #4
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris, under a rock ...
Distribution: Solaris & OpenSolaris based distros, Ubuntu
Posts: 8,134
Thanked: 86
Actually, not only Solaris but also all BSDs, AIX, HP-UX, Irix and macOS X have gzcat being the right command to uncompress gzipped files.

The gzip developers are to blame here, having reused the name of an existing and slightly different command.

From the gzip manual page:

On some systems, zcat may be installed as gzcat to preserve the original link to compress.
jlliagre is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Alsa is broken BlindIrishman Linux - Newbie 3 10-30-2006 05:12 PM
broken ?? Screener Ubuntu 4 08-10-2006 10:56 AM
X Is Broken Carlwill Linux - General 7 07-24-2006 10:15 AM
su is broken Smokey Slackware 1 01-29-2005 03:31 PM
X is broken jclark00001 Linux - Software 6 04-27-2003 08:56 PM


All times are GMT -5. The time now is 02:23 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration