The Messenger of Allah ﷺ traveled on a journey and prayed two rakahs at a time for nineteen days. Ibn Abbas said, "So when we travel for up to nineteen days, we pray two rakahs at a time, but if we stay longer than that, we pray four."
حدثنا هناد بن السري حدثنا أبو معاوية عن عاصم الأحول عن عكرمة
سافر رسول الله ﷺ سفرا فصلى تسعة عشر يوما ركعتين ركعتين قال ابن عباس فنحن نصلي فيما بيننا وبين تسع عشرة ركعتين ركعتين فإذا أقمنا أكثر من ذلك صلينا أربعا
[Its chain of transmission is sahih]. Ahmad narrated it at 1/223 from Abu Muawiya Dareer with the same chain, and he made explicit his hearing of it. Bukhari also narrated it, no. 1080, through another route from Asim Ahwal with the same chain.