All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu ‘alayhi wa sallam, is His Slave and Messenger.
We did not find the narration that the questioner mentioned. However, Abu Ash-Shaykh reported in his book “Ath-Thawaab” on the authority of Naafi` from Ibn ‘Umar that he returned from Ribaat (i.e. guard duty at the frontline) and entered upon ‘Umar ibn Al-Khattaab who asked, “How long did you spend in Ribaat?” He said, “Thirty days.” Thereupon, ‘Umar said to him, “I ask you to return until you complete forty days.” [Ibn Qudaamah in Al-Mughni]
Abdur-Razzaaq narrated in his “Al-Musannaf” on the authority of Yazeed ibn Abi Habeeb that a man from the Ansaar entered upon ‘Umar ibn Al-Khattaab who asked him, “Where have you been?” He answered, “In Ribaat.” ‘Umar asked, “How long did you spend in Ribaat?” He said, “Thirty days.” Thereupon, ‘Umar, may Allaah be pleased with him, said to him, “Why do you not complete forty days?”