Banyaku refers to working different shifts by rotation in the Japanese history.
From old times, there existed Banyaku in charge of guarding institutions related to the Imperial Court such as Eji-joban (serving in Eji [guard] by coming up to Kyoto from a province) in the Ritsuryo system, Oban (guard for the imperial palace of the emperor and retired emperor, and residence of Sekkan-ke [the families which produced the Regent and the Chief Adviser to the Emperor]) in and after the mid Heian period, and so on. The Kamakura bakufu (Japanese feudal government headed by a shogun) imposed various kinds of Banyaku on Gokenin (shogunal retainers of the Kamakura bakufu) across the country as part of military service called Gokeninyaku, and succeeded to part of load of Banyaku to the Imperial Court. The biggest one was called Obanyaku (a job to guard Kyoto), and as well as 'Kyoto Obanyaku' inheriting Oban in Kyoto, there existed 'Kamakura Obanyaku' which guarded a Shogun's palace and governmental institutions in Kamakura. Shugo (provincial constable) in ryoseikoku (province) was granted authority necessary to cause Gokenin in the province to engage in Obanyaku ('Oban-saisoku (Shugo's authority to command Gokenin, lower ranked vassals to guard Kyoto), and such authority was regarded as one of Taibon Sankajo (three major tasks of peacekeeping). On the occasion of Mongol invasion attempts against Japan, Ikokukeigobanyaku (military service imposed on Gokenin [immediate vassals of the shogunate] in the Kyushu area by bakufu in order to provide against the invasion of Yuan dynasty) was added.