When any convict shall be sentenced to solitary imprisonment and hard labor in any jail, the keeper thereof shall execute such sentence of solitary imprisonment, by confining the convict in 1 of the cells, if there be any in such jail, and if there be none, then in the most retired and solitary part of such jail.