Sanitation duty was a type of assignment that could be handed out as a sentence for a crime.
In 2372, Ojuy Gel was sentenced to three weeks community service on sanitation duty by an arbiter for vandalizing a wall on Deep Space 9. (DS9: "Crossfire")
In 2374, Kira Nerys warned Damar to stay out of trouble lest he wind up with sanitation duty. (DS9: "Behind the Lines")