Will the scope be there in logrotate after postrotate directive...?

Hi,
Please check the below code...:wall:

 
if [ `grep -c "/var/log/AAA/BBB" /etc/logrotate.conf` -eq 0 ] ; then
        echo "/var/log/AAA/BBB/xxx_*.log  /var/log/AAA/BBB/yyy_*.log  {"  >> /etc/logrotate.conf
        echo "  weekly"                        >> /etc/logrotate.conf
        echo "  rotate 10"                     >> /etc/logrotate.conf
        echo "  compress"                      >> /etc/logrotate.conf
        echo "  postrotate"                    >> /etc/logrotate.conf
        echo "     /usr/bin/killall -HUP syslogd" >> /etc/logrotate.conf
        echo "     sleep 3"                    >> /etc/logrotate.conf
        echo "     mv /var/log/AAA/BBB/xxx_*.gz  /var/log/AAA/BBB/xxx_`date +%d%b%y`.log.gz" >> /etc/logrotate.conf
        echo "     mv /var/log/AAA/BBB/yyy_*.gz  /var/log/AAA/BBB/yyy_`date +%d%b%y`.log.gz" >> /etc/logrotate.conf
        echo "  endscript"                     >> /etc/logrotate.conf
        echo "  copytruncate"                  >> /etc/logrotate.conf
        echo "}"                               >> /etc/logrotate.conf
fi
 

In this, I am trying to compress and logrotate 2 types of log files in the same folder. Also renaming the files with the current date as a part of them, which denotes the date of rotation. After Postrotate and endscript tags, i am using copytruncate. But in the postrotate tag, I am renaming the file names. So will it effect the copytruncate... or any other directive in the logrotate.conf file...?
Will the previous log files be removed asusual..?
Please help me in this regard...:wall:

If some processes are still running on the logfile, you should not move them (inode loss) you should use a cp and cat combination instead.

Can you plz help me how to do that...?
Here, my requirement is after renaming the ZIP files, the previous log files should be removed without any problem after the postrotate script.
In the postrotate, will the scope of the logrotate be lost.. bcz as we are using normal shell scripting..?
If scope is lost, how to get it back..?