If any civil or military officer having any records, books or papers appertaining to any public office or any court shall resign, or his office be vacated, he shall deliver to his successor all such records, books and papers.