signal18 / replication-manager

Signal 18 repman - Replication Manager for MySQL / MariaDB / Percona Server
https://signal18.io/products/srm
GNU General Public License v3.0
655 stars 167 forks source link

Dbjob to preserve logs #881

Closed svaroqui closed 3 weeks ago

svaroqui commented 3 weeks ago

We should not this anymore and not destroy client info

         error)
            cat $ERROLOG | socat -u stdio TCP:$ADDRESS &>"/tmp/$job.out"
            >$ERROLOG
            ;;
        slowquery)
            cat $SLOWLOG | socat -u stdio TCP:$ADDRESS &>"/tmp/$job.out"
            >$SLOWLOG
            ;;
cat $ERROLOG >> $ERRROLOG_$(date '+%Y-%m-%d')
cat $ERROLOG | socat -u stdio TCP:$ADDRESS &>"/tmp/$job.out"
if [ -f  $ERRROLOG_$(date -d "1 day ago" '+%Y-%m-%d') ]
   gzip $ERRROLOG_$(date -d "1 day ago" '+%Y-%m-%d')  
fi
if [ -f  $ERRROLOG_$(date -d "8 day ago" '+%Y-%m-%d').gz ]
   rm -f $ERRROLOG_$(date -d "8 day ago" '+%Y-%m-%d').gz  
fi
caffeinated92 commented 3 weeks ago

Well, it does not stop truncating. But at least it store in different file. :D

I was thinking about not touching the file. But this is good. We will not need to calculate in replication-manager.