delete logs older than 7 days linux

C++
find /media/bkfolder/ -mtime +7 -name'*.gz' -exec rm {} \;

Source

Also in C++: