If a sheriff is legally removed from office or dies or resigns before the expiration of the term for which the sheriff was commissioned, the chief deputy sheriff shall execute the office of sheriff and perform all things thereunto appertaining and receive and retain the compensation provided by law for sheriffs until another sheriff is commissioned and notice thereof is given to the chief deputy sheriff.
16 P.S. § 1213-A