I have a script which runs as a cronjob
every 30 mins and takes mysqldump
of some tables.
The dump files are stored in /var/log/
as
/var/log/mysqldump/dbname/tablename/2014-06-15-18-30-dbname-tablename.sql
/var/log/mysqldump/dbname2/tablename2/2014-06-15-19-00-dbname2-tablename2.sql
I'm using logrotate
for file rotation, the config file has the following structure:
/var/log/mysqldump/dbname/tablename/*.sql {
daily
rotate 30
compress
nocreate
}
Now my problem is that although logrotate
works fine, it's appending "1" or "2" at the end of the gzipped file names, for instance this is what I have
/var/log/mysqldump/dbname2/tablename2/2014-06-15-19-30-dbname2-tablename2.sql.1.gz
/var/log/mysqldump/dbname1/tablename1/2014-06-15-19-00-dbname1-tablename1.sql.2.gz
I execute logrotate
from within the script as
logrotate -f /path/to/mysqldump-logrotate.conf
What am I doing wrong here?