Sponsored Content
Full Discussion: Logs not rotated
Top Forums UNIX for Beginners Questions & Answers Logs not rotated Post 303027283 by Ralph on Wednesday 12th of December 2018 05:57:12 PM
Old 12-12-2018
Quote:
Originally Posted by MadeInGermany
You can manually run
Code:
logrotate -d /etc/logrotate.conf

and it tells what it would do - without doing anything.

I tried that. Concerning the auth.log it says:
Code:
considering log /var/log/auth.log
  Now: 2018-12-13 06:15
  Last rotated at 2018-12-12 15:15
  log does not need rotating (log has been rotated at 2018-12-12 15:15, that is not week ago yet)

But that was yesterday when I set off the logrotate command manually.

The problem appears to be the test for -d /run/systemd/system. If the directory exists the script exits right away. (See my original post.)
Code:
# skip in favour of systemd timer
if [ -d /run/systemd/system ]; then
     exit 0 
fi

I don't understand how it could detect the system timer by checking for the existence of that directory.

--- Post updated at 10:57 PM ---

Quote:
Originally Posted by Ralph
What if I restart the machine? Being in the /run directory won't it be recreated as 'system' when the system comes up again?
Quote:
Originally Posted by RudiC
"for a test" doesn't necessarily include a reboot...

The machine doesn't run 24/7. So unless I perform a test right after renaming the directory (which one?) it will be recreated as 'system' after a reboot. (I just rebooted and checked.)

Last edited by Ralph; 12-12-2018 at 06:30 PM..
 

8 More Discussions You Might Find Interesting

1. UNIX Desktop Questions & Answers

Logs

hi My name is Juan I dont can clear wtmp and similiar files how i do it? thanks (4 Replies)
Discussion started by: jtapia
4 Replies

2. UNIX for Dummies Questions & Answers

logs

can i include this command into my crontab file > /var/adm/wtmp to clear the contents on a regular basis ? what about file permissions ? (6 Replies)
Discussion started by: cubicle^dweller
6 Replies

3. Shell Programming and Scripting

Logs

Hey Guys, i am new into shell programming and i have to do one script which have to record all the commands entered by a specific user. Example of that, i have a system running on unix, several users are using this system, i have to create like a databse which will record every user entered that... (5 Replies)
Discussion started by: charbel
5 Replies

4. UNIX for Advanced & Expert Users

logs

Hy, I have a question I have a directory in a unix server, Some of my files have a diffrent access time, from the time i accessed them last, I think some one has copied it,it's not an important file,but none the less,it is my file,It mistakenly had a 777 permission( yes ,I know it is a noob's... (1 Reply)
Discussion started by: lordmod
1 Replies

5. Shell Programming and Scripting

Grep yesterday logs from weblogic logs

Hi, I am trying to write a script which would go search and get the info from the logs based on yesterday timestamp and write yesterday logs in new file. The log file format is as follows: """"""""""""""""""""""""""... (3 Replies)
Discussion started by: harish.parker
3 Replies

6. UNIX Desktop Questions & Answers

regarding logs

Hi , I am running an application on my windows and it logs are generated at /var/logs and for this i have to go this location and then do tail -f , Is there any command you can advise me so that when I execute this command at this location that logs get displayed fully and as the application... (3 Replies)
Discussion started by: KAREENA18
3 Replies

7. Shell Programming and Scripting

Help needed on Perl Script to Handle Log files that are rotated using logrotate

Hello all, I am working on a perl script which will read weblogic logfile and send the error messages to Zenoss Monitoring tool. At present the script works and it can able to send the error messages to Zenoss. The problem comes when the logrotate has been applied to the weblogic log file. At... (3 Replies)
Discussion started by: kar_333
3 Replies

8. Shell Programming and Scripting

If I ran perl script again,old logs should move with today date and new logs should generate.

Appreciate help for the below issue. Im using below code.....I dont want to attach the logs when I ran the perl twice...I just want to take backup with today date and generate new logs...What I need to do for the below scirpt.............. 1)if logs exist it should move the logs with extention... (1 Reply)
Discussion started by: Sanjeev G
1 Replies
DH_SYSTEMD_ENABLE(1)						     Debhelper						      DH_SYSTEMD_ENABLE(1)

NAME
dh_systemd_enable - enable/disable systemd unit files SYNOPSIS
dh_systemd_enable [debhelperoptions] [--no-enable] [--name=name] [unitfile...] DESCRIPTION
dh_systemd_enable is a debhelper program that is responsible for enabling and disabling systemd unit files. In the simple case, it finds all unit files installed by a package (e.g. bacula-fd.service) and enables them. It is not necessary that the machine actually runs systemd during package installation time, enabling happens on all machines in order to be able to switch from sysvinit to systemd and back. In the complex case, you can call dh_systemd_enable and dh_systemd_start manually (by overwriting the debian/rules targets) and specify flags per unit file. An example is colord, which ships colord.service, a dbus-activated service without an [Install] section. This service file cannot be enabled or disabled (a state called "static" by systemd) because it has no [Install] section. Therefore, running dh_systemd_enable does not make sense. For only generating blocks for specific service files, you need to pass them as arguments, e.g. dh_systemd_enable quota.service and dh_systemd_enable --name=quotarpc quotarpc.service. FILES
debian/package.service, debian/package@.service If this exists, it is installed into lib/systemd/system/package.service (or lib/systemd/system/package@.service) in the package build directory. debian/package.tmpfile If this exists, it is installed into usr/lib/tmpfiles.d/package.conf in the package build directory. (The tmpfiles.d mechanism is currently only used by systemd.) debian/package.target, debian/package@.target If this exists, it is installed into lib/systemd/system/package.target (or lib/systemd/system/package@.target) in the package build directory. debian/package.socket, debian/package@.socket If this exists, it is installed into lib/systemd/system/package.socket (or lib/systemd/system/package@.socket) in the package build directory. debian/package.mount If this exists, it is installed into lib/systemd/system/package.mount in the package build directory. debian/package.path, debian/package@.path If this exists, it is installed into lib/systemd/system/package.path (or lib/systemd/system/package@.path) in the package build directory. debian/package.timer, debian/package@.timer If this exists, it is installed into lib/systemd/system/package.timer (or lib/systemd/system/package@.timer) in the package build directory. OPTIONS
--no-enable Disable the service(s) on purge, but do not enable them on install. Note that this option does not affect whether the services are started. That is controlled by dh_systemd_start(1) (using e.g. its --no-start option). --name=name Install the service file as name.service instead of the default filename, which is the package.service. When this parameter is used, dh_systemd_enable looks for and installs files named debian/package.name.service instead of the usual debian/package.service. NOTES
Note that this command is not idempotent. dh_prep(1) should be called between invocations of this command (with the same arguments). Otherwise, it may cause multiple instances of the same text to be added to maintainer scripts. Note that dh_systemd_enable should be run before dh_installinit. The default sequence in dh does the right thing, this note is only relevant when you are calling dh_systemd_enable manually. SEE ALSO
dh_systemd_start(1), debhelper(7) AUTHORS
pkg-systemd-maintainers@lists.alioth.debian.org 11.1.6ubuntu2 2018-05-10 DH_SYSTEMD_ENABLE(1)
All times are GMT -4. The time now is 02:41 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy