عن أبي أمامة رضي الله عنهما قال سمعت رسول الله صلى الله عليه و سلم يقول أربعة تجري عليهم أجورهم بعد الموت رجل مات مرابطا في سبيل الله ورجل علم علما فأجره يجري عليه ما عمل به ورجل أجرى صدقة فأجرها له ما جرت ورجل ترك ولدا صالحا يدعو له رواه الإمام أحمد والبزار والطبراني في الكبير والأوسط وهو صحيح مفرقا من حديث غير واحد من الصحابة رضي الله عنهم (الترغيب والترهيب 1/160)
Hadhrat Abu Umaamah (Radhiyallahu Anhu) reports that Rasulullah (Sallallahu Alaihi Wasallam) said: “There are four such actions that a servant carries out, the reward of which will continue to be written for him in his grave (even) after his demise; (1) the one who passed away while guarding the Islamic frontiers in the path of Allah Ta’ala (2) the one who had imparted some Deeni knowledge, thus its reward will continue for him as long as that knowledge is practiced upon (3) the one who had given sadaqah (sadaqah jaariyah e.g. he dug a borehole or a well etc.), thus its reward will continue for him as long as the benefit of the sadaqah continues (4) and the one who left behind a pious child who makes duaa for him after his demise.”