getting error message "error: error opening /home/attlas/data/flog/abc1.log: No such file or directory" when i use firstaction parameter

Bug #1829181 reported by Penchal Reddy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
logrotate (Ubuntu)
New
Undecided
Unassigned

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@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@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 post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.