Soldiers who are patrolling in a vehicle on Shabbat may not deviate from the established route in order to eat in a more convenient outpost or to meet up with friends, because driving is permitted to them only for the sake of security. However, if there is no specific patrol route, the soldiers may plan the route to suit their convenience. If they have a half-hour break to eat and rest, they may plan for that break to be at a place of their convenience. If they are expected to patrol inside settlements to make the army presence felt and to deter terrorists, they may park near a synagogue or somewhere convenient for eating.
Soldiers who know that they will be commencing a military operation on Shabbat must spend Shabbat on their base, since if they travel home before Shabbat, they would have to desecrate Shabbat to return to the base (see MB 344:11). Even if the commanding officer is married and will greatly upset his family members by remaining on base, if the operation will definitely take place on Shabbat, he may not go home, since that would force him to travel back on Shabbat. However, if there is a chance that the operation will be canceled, he may go home for Shabbat. As long as it is not certain that the operation will be executed on Shabbat, he may try to preserve his and his family’s oneg Shabbat. The officer should be sure to explain to his family that since it is uncertain whether or not he will be called, he may remain at home. This way they will not belittle Shabbat observance. If he finds out on Shabbat that the operation is taking place, he may drive to the base. If it can be arranged for a non-Jew to drive him to the base on Shabbat, then even if he is certain that the operation will take place on Shabbat, he may go home for Shabbat and then have the non-Jew drive him to the base. After the operation, if a non-Jew is available to drive him home, he may travel with him. If no non-Jewish driver is available, he may not return home.
If soldiers are summoned to deal with an incident, but before they arrive it becomes clear that they are not needed, they should be called and told not to come, in order to minimize Shabbat desecration. An additional justification for this is that if it later becomes clear to soldiers that they were not informed of the cancelation because people did not want to use the phone on Shabbat, there is a concern that if they are summoned again on Shabbat, they will hesitate to come (see above, n. 10).
If an observant soldier is assigned guard duty or patrol duty on Shabbat, it is good if he swaps his Shabbat assignment with a non-observant soldier’s weekday assignment as long as the non-observant soldier is willing and there is no concern that switching the assignments will cause the guard duty to be taken lightly. Thus, the observant soldier will be able to pray and enjoy Shabbat, and the non-observant soldier will accrue merit for enabling this. Additionally, while the non-observant soldier is guarding, he is doing a mitzva and not desecrating Shabbat. Nevertheless, the observant soldier need not initiate such a swap, because defending the country is a mitzva, and there is no need to seek ways to get out of it on Shabbat (see Ha-tzava Ka-halakha ch. 27).
. The Talmud states in Yoma 84b that one may engage in actions that are aimed at saving lives even when the actions serve a secondary purpose as well. For example, one may use a net to retrieve a child who fell into a river, even if some fish will be caught as well. Similarly, one may build steps to rescue a child from a pit, even if these steps will be useful later on as well. This is the ruling of SA 328:13. All this is on condition that no additional melakha is done to achieve the secondary purpose. Rishonim disagree about whether one may intend to achieve the secondary purpose; this is discussed in SHT ad loc. 17. However, in the case of patrolling soldiers, even if they intend to eat at a convenient place, it would seem that all would permit this. After all, there is a slight tactical advantage in doing so, as they will be more refreshed as a result. See Ha-tzava Ka-halakha 17:6, pp. 172-3.
. See section 10 and n. 11 above regarding a doctor who has a shift on Shabbat. It emerges from there that when it is certain that a military operation will begin on Shabbat, the officers and soldiers must spend Shabbat on the base. According to R. Shlomo Zalman Auerbach, they may spend Shabbat at home and then drive to the base on Shabbat, but the accepted ruling is to be stringent. Even if one could be lenient on a one-time basis, one may not rely on this leniency regularly (see section 2 and n. 7 above). Furthermore, R. Shlomo Zalman Auerbach himself did not rule this way in practice. He only said that one is not obligated to object if someone else is lenient (Ha-tzava Ka-halakha 26:19 and n. 41). Therefore, in practice, an officer who knows that he will need to lead an operation on Shabbat should remain on base. However, if there is a chance that the operation will be canceled, it would seem that a career officer may spend Shabbat at home. If he is called up, then he travels to the base. We must take into account that if we are too stringent and demand that he remains on base, the pressure from his family to leave the army will increase. Even though we do not use this reasoning to allow him to return home after an operation if Torah prohibitions are involved (as explained above in n. 12), nevertheless, before the operation, when there is some doubt about whether it will be carried out, he may be lenient. See further above, 2:10-11. If a non-Jewish driver is available, the officer may travel both ways with him just as doctors and nurses do, as explained above in section 10 and n. 12.