Appropriately, janitor derives from the Latin janus, meaning “arch” or “gate.” As an occupation, the word originating in the 1580's referred to one who keeps guard at an entry gate:
"At the expiration of that time, wheels were heard whirling up to the gate--the young janitor went out with his gate-keys."
In 1708 the word meant a "caretaker of a building, man employed to see that rooms are kept clean and in order." Fem. forms were janitress
Janus (where we get the word janitor) is also the name of the Roman deity regarded as the doorkeeper of Heaven and associated with doors and gates. He was depicted with a two-faced head (perhaps to see those coming in as well as those going out); consequently, the adjective Janus-faced can mean “two-faced” or “duplicitous.” As he is also associated with beginnings, Janus also gives us the name January for the first month on the calendar.
The noun custodian, which describes a job similar to a janitor, can also refer to one who keeps watch or guard.