in which scriptures is ganesha mentioned?
Black Yajurveda
Ganesha
Two verses in texts belonging to Black Yajurveda, ' (2.9.1) and ' (10.1), appeal to a deity as "the tusked one" (), "elephant-faced" (Hastimukha), and "with a curved trunk" (). 
who is the god of luck in hindu UNANSWERABLE
wiki:11213256
Ganesha [SEP] Vedic and epic literature
The Sangam period Tamil poet Avvaiyar (3rd century BCE), invokes Ganesha while preparing the invitation to the three Tamil Kingdoms for giving away in marriage of Angavay and Sangavay of Ceylon in marriage to the King of Tirucovalur (pp. 57–59). Two verses in texts belonging to Black Yajurveda, ' (2.9.1) and ' (10.1), appeal to a deity as "the tusked one" (), "elephant-faced" (Hastimukha), and "with a curved trunk" (). These names are suggestive of Ganesha, and the 14th century commentator Sayana explicitly establishes this identification. The description of Dantin, possessing a twisted trunk () and holding a corn-sheaf, a sugar cane, and a club, is so characteristic of the Puranic Ganapati that Heras says "we cannot resist to accept his full identification with this Vedic Dantin".