opensuse13.1 logrotate = problem .Please Help me

LogRotate didn`t work… ;(
This is my test steps:
1.

# cat /etc/logrotate.d/test6
/tmp/test6/test6.log
{
    daily
    missingok
    rotate 5
    create 640 root root
}


  1. Folder is EMPT
# ls -la /tmp/test6/
total 16
drwxr-xr-x  2 root root  4096 Jun 10 07:00 .
drwxrwxrwt 29 root root 12288 Jun 10 07:00 ..
# 


 # logrotate -dfv /etc/logrotate.d/test6 
reading config file /etc/logrotate.d/test6

Handling 1 logs

rotating pattern: /tmp/test6/test6.log
 forced from command line (5 rotations)
empty log files are rotated, old logs are removed
considering log /tmp/test6/test6.log
  log /tmp/test6/test6.log does not exist -- skipping


  1. Create TEST6.log fle. it`s OK.
 # "test test tes"> /tmp/test6/test6.log
# logrotate -dfv /etc/logrotate.d/test6 
reading config file /etc/logrotate.d/test6

Handling 1 logs

rotating pattern: /tmp/test6/test6.log
 forced from command line (5 rotations)
empty log files are rotated, old logs are removed
considering log /tmp/test6/test6.log
  log needs rotating
rotating log /tmp/test6/test6.log, log->rotateCount is 5
dateext suffix '-20170610'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
renaming /tmp/test6/test6.log.5 to /tmp/test6/test6.log.6 (rotatecount 5, logstart 1, i 5), 
renaming /tmp/test6/test6.log.4 to /tmp/test6/test6.log.5 (rotatecount 5, logstart 1, i 4), 
renaming /tmp/test6/test6.log.3 to /tmp/test6/test6.log.4 (rotatecount 5, logstart 1, i 3), 
renaming /tmp/test6/test6.log.2 to /tmp/test6/test6.log.3 (rotatecount 5, logstart 1, i 2), 
renaming /tmp/test6/test6.log.1 to /tmp/test6/test6.log.2 (rotatecount 5, logstart 1, i 1), 
renaming /tmp/test6/test6.log.0 to /tmp/test6/test6.log.1 (rotatecount 5, logstart 1, i 0), 
renaming /tmp/test6/test6.log to /tmp/test6/test6.log.1
creating new /tmp/test6/test6.log mode = 0640 uid = 0 gid = 0
removing old log /tmp/test6/test6.log.6
error: error opening /tmp/test6/test6.log.6: No such file or directory


6. WHERE IS /tmp/test6/test6.log.1 ???

 # ls -la /tmp/test6/
total 20
drwxr-xr-x  2 root root  4096 Jun 10 07:11 .
drwxrwxrwt 29 root root 12288 Jun 10 07:00 ..
-rw-r--r--  1 root root    33 Jun 10 07:11 test6.log


Please Help me !!!

About linux:

 # uname -a
Linux SOVA 3.11.6-4-desktop #1 SMP PREEMPT Wed Oct 30 18:04:56 UTC 2013 (e6d4a27) x86_64 x86_64 x86_64 GNU/Linux

Serg

You are using the **debug **flag which disables executing the actual changes.

-d, --debug
Turns on debug mode and implies -v.  In debug mode, no changes will be made to the logs or to the logrotate state file.

Drop -d and it’ll actually do something.

Thank you !

Problem Resolved !

Serg

:wink: