Deuteronomy 31
21 Ref And it shall come to pass, when many evils and troubles are come upon them, that this song shall testify before them as a witness; for it shall not be forgotten out of the mouths of their seed: for I know their imagination which they frame this day, before I have brought them into the land which I sware.
22 Ref So Moses wrote this song the same day, and taught it the children of Israel.