How to insert a date inside the filename with logrotate
To insert the date within the filename (and not as extension) of a file under Linux while rotating a file it is correct to use:
# Daily rotation daily# We keep original file live copytruncate# Rotation is 1 so we have always .1 as extension rotate 1# If file is missing keep working missingok sharedscripts postrotate day=$(date +%Y-%m-%d) mv blabla.csv.1 /var/www/gamelogs/dir/blabla$day.csv endscript}
This is simple and works fine.