As the weekly day of rest approaches, strict practical measures are set in motion to protect the sanctity of the time and the borders of Jerusalem, preventing widespread violation of the Sabbath. The process begins on Friday afternoon. As the sun begins to lower toward the edge of the sky, long shadows are cast over the city gates [אבן עזרא, מצודת ציון, רש"י, רלב"ג, רב סעדיה גאון, מצודת דוד, ביאור שטיינזלץ]. This specific timeframe is noted to start immediately after midday [מלבי"ם].
At this point, a firm command is issued to lock the city gates and keep them shut until the Sabbath concludes [רב סעדיה גאון, ביאור שטיינזלץ]. The primary approach among commentators is that this closure is intended to block foreign merchants from entering the city. Their presence serves as a spiritual stumbling block, creating a risk that the local residents might be tempted to purchase goods and thereby break the Sabbath [רש"י, רלב"ג, מצודת דוד]. These merchants are identified as peddlers because they mix many different types of goods together to sell [אבן עזרא].
To ensure the order is fully obeyed, personal guards and military men are stationed at the city entrances [ביאור שטיינזלץ]. The directive includes an absolute ban on opening the doors for anyone carrying a load [מלבי"ם]. On a practical level, these guards must remain highly vigilant to prevent any goods from being smuggled into the city through small openings that exist within the walls and gates [מצודת דוד].