Sounds like his anal glands are on the infected side and probably needs some antibiotics from the vets.
Moo-Moo kept on getting ear infections, along with everything else

. (I am handing over my wages to the vets every month at the moment!

) Canaural drops were prescribed and no sooner had we finished treating it, within a week or so it was back. My vet did a swab of his ears as it was going on too long and sent it off for cultures. It came back that he had the Staphylococcus bacteria present and Otomax ear drops were perscribed and touch wood, his ears have been fine. He has to have them bathed twice a week now in Epi-otic and hopefully, this will stop the infection coming back.
He's also suffered lip fold dermatitis as well and was given Antirobe antibiotics which upset his tummy a bit, but we perservered and along with bathing in hibiscrub daily, it gradually cleared up. He now has it bathed every other day and it has kept it at bay.
Agree with the others regarding the food as he may have allergies and it might be worth having him allergy tested - it is quite expensive ( our insurance paid for it ) worth it in the long run for Monty. Our old dog Sam, who is longer with us

was tested and he was intolerant to wheat, soya, barley, beef, lamb and chicken and we had been feeding him a chicken based food prior to this, so was glad we had it done so that we could get him sorted on a food that agreed with him. It was a long time ago but think it was JWB fish and rice we changed him to.
Hope this has been helpful.
Heather.