[Bug 1829181] [NEW] getting error message "error: error opening /home/attlas/data/flog/abc1.log: No such file or directory" when i use firstaction parameter
Penchal Reddy
pr8721 at att.com
Wed May 15 09:50:11 UTC 2019
Public bug reported:
Ubuntu 14.04
logrotate 3.8.7
Using logrotate to remove old logs and i found the solution with
logroate and used below configuration to remove old files with
'firstaction' parameter
/home/attlas/data/flog/abc*.log
/home/attlas/data/flog/xyz*.log
{
rotate 0
daily
missingok
copy
firstaction
find /home/attlas/data/flog -maxdepth 1 -mtime +10 -name "abc*.log" -print -delete
find /home/attlas/data/flog -maxdepth 1 -mtime +10 -name "xyz*.log" -print -delete
endscript
}
and when i executed 'logrotate -f /etc/logrotate.conf' manullay getting
below errors
root at kosmos:/etc/logrotate.d# logrotate -f /etc/logrotate.conf
/home/attlas/data/flog/abc1.log
/home/attlas/data/flog/abc2.log
/home/attlas/data/flog/abc3.log
/home/attlas/data/flog/xyz1.log
/home/attlas/data/flog/xyz2.log
/home/attlas/data/flog/xyz3.log
error: error opening /home/attlas/data/flog/abc1.log: No such file or directory
error: error opening /home/attlas/data/flog/abc2.log: No such file or directory
error: error opening /home/attlas/data/flog/abc3.log: No such file or directory
error: error opening /home/attlas/data/flog/xyz1.log: No such file or directory
error: error opening /home/attlas/data/flog/xyz2.log: No such file or directory
error: error opening /home/attlas/data/flog/xyz3.log: No such file or directory
to adaquate this i have added 'sharedscripts' parameter as below and now
i am avoiding duplicates of error message
/home/attlas/data/flog/abc*.log
/home/attlas/data/flog/xyz*.log
{
rotate 0
daily
missingok
copy
sharedscripts
firstaction
find /home/attlas/data/flog -maxdepth 1 -mtime +10 -name "abc*.log" -print -delete
find /home/attlas/data/flog -maxdepth 1 -mtime +10 -name "xyz*.log" -print -delete
endscript
}
and Now if i execute 'logrotate -f /etc/logrotate.conf' manually still i
am getting single line error message as below
root at kosmos:/etc/logrotate.d# logrotate -f /etc/logrotate.conf
/home/attlas/data/flog/abc1.log
/home/attlas/data/flog/abc2.log
/home/attlas/data/flog/abc3.log
/home/attlas/data/flog/xyz1.log
/home/attlas/data/flog/xyz2.log
/home/attlas/data/flog/xyz3.log
error: error opening /home/attlas/data/flog/abc1.log: No such file or directory
could you please suggest how to avoid this error
** Affects: logrotate (Ubuntu)
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to logrotate in Ubuntu.
https://bugs.launchpad.net/bugs/1829181
Title:
getting error message "error: error opening
/home/attlas/data/flog/abc1.log: No such file or directory" when i use
firstaction parameter
Status in logrotate package in Ubuntu:
New
Bug description:
Ubuntu 14.04
logrotate 3.8.7
Using logrotate to remove old logs and i found the solution with
logroate and used below configuration to remove old files with
'firstaction' parameter
/home/attlas/data/flog/abc*.log
/home/attlas/data/flog/xyz*.log
{
rotate 0
daily
missingok
copy
firstaction
find /home/attlas/data/flog -maxdepth 1 -mtime +10 -name "abc*.log" -print -delete
find /home/attlas/data/flog -maxdepth 1 -mtime +10 -name "xyz*.log" -print -delete
endscript
}
and when i executed 'logrotate -f /etc/logrotate.conf' manullay
getting below errors
root at kosmos:/etc/logrotate.d# logrotate -f /etc/logrotate.conf
/home/attlas/data/flog/abc1.log
/home/attlas/data/flog/abc2.log
/home/attlas/data/flog/abc3.log
/home/attlas/data/flog/xyz1.log
/home/attlas/data/flog/xyz2.log
/home/attlas/data/flog/xyz3.log
error: error opening /home/attlas/data/flog/abc1.log: No such file or directory
error: error opening /home/attlas/data/flog/abc2.log: No such file or directory
error: error opening /home/attlas/data/flog/abc3.log: No such file or directory
error: error opening /home/attlas/data/flog/xyz1.log: No such file or directory
error: error opening /home/attlas/data/flog/xyz2.log: No such file or directory
error: error opening /home/attlas/data/flog/xyz3.log: No such file or directory
to adaquate this i have added 'sharedscripts' parameter as below and
now i am avoiding duplicates of error message
/home/attlas/data/flog/abc*.log
/home/attlas/data/flog/xyz*.log
{
rotate 0
daily
missingok
copy
sharedscripts
firstaction
find /home/attlas/data/flog -maxdepth 1 -mtime +10 -name "abc*.log" -print -delete
find /home/attlas/data/flog -maxdepth 1 -mtime +10 -name "xyz*.log" -print -delete
endscript
}
and Now if i execute 'logrotate -f /etc/logrotate.conf' manually still
i am getting single line error message as below
root at kosmos:/etc/logrotate.d# logrotate -f /etc/logrotate.conf
/home/attlas/data/flog/abc1.log
/home/attlas/data/flog/abc2.log
/home/attlas/data/flog/abc3.log
/home/attlas/data/flog/xyz1.log
/home/attlas/data/flog/xyz2.log
/home/attlas/data/flog/xyz3.log
error: error opening /home/attlas/data/flog/abc1.log: No such file or directory
could you please suggest how to avoid this error
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/logrotate/+bug/1829181/+subscriptions
More information about the foundations-bugs
mailing list