[Archivesspace_Users_Group] logrotate and "binary" logs

Dyson-Smith, Bridger bdysonsm at utk.edu
Wed Jun 16 12:19:10 EDT 2021


Hi Peter,

On Tue, 2021-06-15 at 08:42 +0000, Peter Heiner wrote:
> > $ file as-log.out
> > as-log.out: data
> This looks like the file utility was unable to determine the type of
> as-log.out. As it should normally be able to identify all types emitted
> by logrotate, this suggests to me that the actual file it was ran on is
> corrupt.
I'm not sure about corrupt, but I won't rule it out. I'm not sure
because `cat`, `tail`, and some other utilities seem to work correctly
(but maybe they're more forgiving?). Thanks for the suggestion!

> > archivesspace/logs/archivesspace.out {
> This may be a result of pasting, but AFAIK logrotate requires an
> absolute path.
You're absolutely right - bad copy'pasta on my part; that should read:
`/vhosts/archivesspace/logs/archivesspace.out {`

> >        compress
> This will default to gzip compression, with an extension '.<number>.gz'
> added to the filename. Normally, you would use the z* utilities (zcat,
> zless, zmore, zgrep, zdiff) to handle rotated logs as these will also
> handle uncompressed streams. I note that the filename above does not
> have the usual extension, but this may also be a result of
> pasting/obfuscation.
> 
> 

/vhosts/archivesspace/logs% ls 
archivesspace.out              archivesspace.out-20210611.gz 
archivesspace.out-20210613.gz  archivesspace.out-20210615.gz
archivesspace.out-20210610.gz  archivesspace.out-20210612.gz 
archivesspace.out-20210614.gz  archivesspace.out-20210616.gz

We're good here (we use the datext in our logrotate.conf), and zgrep
(thank you for the reminder!) works fine on the *.gz files. 

The `aspace-log.out` is a copy of log from pre-logrotate, with a
different name (i.e. `cp archivesspace.out ~/aspace-out.log`).  

> You should be able to run logrotate -d <configfile> and see all actions
> that would be performed according to configfile.
> 
> 
Sadly this doesn't seem to provide any new information:


% logrotate -dv /etc/logrotate.d/archivesspace
reading config file /etc/logrotate.d/archivesspace
Allocating hash table for state file, size 15360 B

Handling 1 logs

rotating pattern: /vhosts/archivesspace/logs/archivesspace.out  after 1
days (7 rotations)
empty log files are not rotated, old logs are removed
considering log /vhosts/archivesspace/logs/archivesspace.out
  log does not need rotating (log has been rotated at 2021-6-16 3:45,
that is not day ago yet)



> p
> 
> 
Thanks again for your time, Peter - I really appreciate the help!
Best,
Bridger

> _______________________________________________
> Archivesspace_Users_Group mailing list
> Archivesspace_Users_Group at lyralists.lyrasis.org
> http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group



More information about the Archivesspace_Users_Group mailing list