LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
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
 
LinkBack Search this Thread
Old 03-25-2007, 06:56 PM   #1
keysorsoze
Member
 
Registered: Apr 2004
Location: Queens, NY
Distribution: Red Hat, Solaris
Posts: 295

Rep: Reputation: 30
Zcat broken?


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.
 
Old 03-25-2007, 11:22 PM   #2
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Ubuntu, OEL
Posts: 9,157

Rep: Reputation: 238Reputation: 238Reputation: 238
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.
 
Old 03-27-2007, 09:17 PM   #3
keysorsoze
Member
 
Registered: Apr 2004
Location: Queens, NY
Distribution: Red Hat, Solaris
Posts: 295

Original Poster
Rep: Reputation: 30
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.
 
Old 03-28-2007, 01:01 AM   #4
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Ubuntu, OEL
Posts: 9,157

Rep: Reputation: 238Reputation: 238Reputation: 238
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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


All times are GMT -5. The time now is 07:18 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
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration