Deuteronomy 31:7-17

7 And Moses called unto Joshua and said unto him in the sight of all Israel, "Be strong and of good courage; for thou must go with this people unto the land which the LORD hath sworn unto their fathers to give them, and thou shalt cause them to inherit it.
8 And the LORD, He it is who doth go before thee. He will be with thee, He will not fail thee, neither forsake thee. Fear not, neither be dismayed."
9 And Moses wrote this law and delivered it unto the priests, the sons of Levi, who bore the ark of the covenant of the LORD, and unto all the elders of Israel.
10 And Moses commanded them, saying, "At the end of every seven years, in the solemnity of the year of release, in the Feast of Tabernacles,
11 when all Israel has come to appear before the LORD thy God in the place which He shall choose, thou shalt read this law before all Israel in their hearing.
12 Gather the people together -- men, and women, and children, and thy stranger who is within thy gates -- that they may hear, and that they may learn, and fear the LORD your God, and observe to do all the words of this law,
13 and that their children, who have not known any thing, may hear and learn to fear the LORD your God as long as ye live in the land whither ye go over the Jordan to possess it."
14 And the LORD said unto Moses, "Behold, thy days approach that thou must die. Call Joshua, and present yourselves in the tabernacle of the congregation, that I may give him a charge." And Moses and Joshua went and presented themselves in the tabernacle of the congregation.
15 And the LORD appeared in the tabernacle in a pillar of a cloud, and the pillar of the cloud stood over the door of the tabernacle.
16 And the LORD said unto Moses, "Behold, thou shalt sleep with thy fathers; and this people will rise up and go a whoring after the gods of the strangers of the land whither they go to be among them, and will forsake Me and break My covenant which I have made with them.
17 Then My anger shall be kindled against them in that day, and I will forsake them, and I will hide My face from them, and they shall be devoured; and many evils and troubles shall befall them, so that they will say in that day, `Have not these evils come upon us because our God is not among us?'