Every sheriff, at the expiration of his term of office, or on resigning, or otherwise vacating the office, shall deliver all writs in his possession unexecuted to his successor, who shall give a receipt for the same, and shall execute and return them. The sheriff shall also deliver to his successor a certified list of the names of all persons confined in the jail, and the cause of their commitment, and a copy of said list shall be filed in the office of the clerk of the circuit court by the sheriff receiving the same.