Every sheriff, jailer, police officer, or other officer or person in charge of any jail or lockup who shall violate any preceding provision of this chapter shall, for each such violation, be guilty of a misdemeanor, and on a second conviction shall be adjudged to be incapable of holding the office of sheriff, jailer, police officer, or keeper of any jail or lockup, as the case may be, for the period of six years.