I heard the Messenger of Allah ﷺ say, "When a servant falls ill or travels, there is recorded for him the equivalent of what he used to do when he was at home and in good health."
سمعت رسول الله ﷺ يقول: إذا مرض العبد أو سافر، كتب له مثل ما كان يعمل مقيما صحيحا.
Bukhari narrated it in the Book of Jihad (2996) from Matar bin Fadl, who said, Yazid bin Harun narrated to us, Awwam narrated to us, Ibrahim Abu Ismail Saksaki narrated to us, he said, I heard Abu Burda, who had traveled together with Yazid bin Abu Kabsha on a journey. Yazid used to fast while traveling, so Abu Burda said to him, "I heard Abu Musa say many times," and then he related the hadith.