![]() |
| Le forum de référence en programmation et développement. Articles, cours et tutoriels du débutant au chef de projet et DBA confirmé. | |||||||
|
|||||||
| Debian Vos questions sur la distribution Debian |
![]() |
|
|
Outils de la discussion |
|
|
#1 (permalink) |
|
Membre régulier
![]() Date d'inscription: juillet 2006
Messages: 139
|
Bonsoir,
Pourquoi je ne peux pas faire cela ? Je veux créer un dossier si jamais il n'existe pas et ensuite déplacer mes logs dedans j'ai donc dans le fichier /etc/logrotate.d/auth Code :
/var/log/auth.log* {
#olddir /var/log/auth_bak
#daily
size 100k
compress
delaycompress
rotate 2
missingok
nocreate
sharedscripts
#olddir /var/log/auth_bak
prerotate
test -d /var/log/auth_bak || /bin/mkdir /var/log/auth_bak
endscript
#postrotate
# test ! -e /var/run/squid.pid || /usr/sbin/squid -k rotate
#endscript
olddir /var/log/auth_bak
}
Je lance la commande Code :
logrotate -d /etc/logrotate.d/auth Code :
reading config file /etc/logrotate.d/auth reading config info for /var/log/auth.log* olddir is now /var/log/auth_bak error: /etc/logrotate.d/auth:19 error verifying olddir path /var/log/auth_bak: No such file or directory Code :
reading config file /etc/logrotate.d/auth
reading config info for /var/log/auth.log*
Handling 1 logs
rotating pattern: /var/log/auth.log* 102400 bytes (2 rotations)
empty log files are rotated, old logs are removed
considering log /var/log/auth.log
log needs rotating
considering log /var/log/auth.log.0
log does not need rotating
considering log /var/log/auth.log.2.gz
log does not need rotating
considering log /var/log/auth.log.4.gz
log does not need rotating
considering log /var/log/auth.log.5.gz
log needs rotating
considering log /var/log/auth.log.6.gz
log does not need rotating
running shared prerotate script
running script with arg /var/log/auth.log* : "
test -d /var/log/auth_bak || /bin/mkdir /var/log/auth_bak
"
rotating log /var/log/auth.log, log->rotateCount is 2
previous log /var/log/auth.log.1 does not exist
renaming /var/log/auth.log.2.gz to /var/log/auth.log.3.gz (rotatecount 2, logstart 1, i 2),
renaming /var/log/auth.log.1.gz to /var/log/auth.log.2.gz (rotatecount 2, logstart 1, i 1),
renaming /var/log/auth.log.0.gz to /var/log/auth.log.1.gz (rotatecount 2, logstart 1, i 0),
renaming /var/log/auth.log to /var/log/auth.log.1
removing old log /var/log/auth.log.3.gz
rotating log /var/log/auth.log.5.gz, log->rotateCount is 2
previous log /var/log/auth.log.5.gz.1 does not exist
renaming /var/log/auth.log.5.gz.2.gz to /var/log/auth.log.5.gz.3.gz (rotatecount 2, logstart 1, i 2),
renaming /var/log/auth.log.5.gz.1.gz to /var/log/auth.log.5.gz.2.gz (rotatecount 2, logstart 1, i 1),
renaming /var/log/auth.log.5.gz.0.gz to /var/log/auth.log.5.gz.1.gz (rotatecount 2, logstart 1, i 0),
renaming /var/log/auth.log.5.gz to /var/log/auth.log.5.gz.1
removing old log /var/log/auth.log.5.gz.3.gz
Si vous avez une solution, je suis preneur. Bonne soirée. Fluxy |
|
|
|
![]() |
![]() |
||
logrotate prerotate mkdir
|
||
| Outils de la discussion | |
|
|