The mittimus or process by which any prisoner is committed or discharged from jail, or an attested copy of the mittimus or process, shall be regularly filed in its order and safely kept by the sheriff, or jailer, under the sheriff’s direction.