||Born in Sale Morocco, he received his early education from his grandfather. R. Hayyim Atar settled in Meknes after the death of his great-uncle Shem Tov in order to manage his business in partnership with Shem Tov's son, whose daughter he married. There he studied and taught but the deterioration of the economic and political situation in Morocco and his belief that redemption was imminent induced him to settle in Erez Israel. He was encouraged in this decision when he learned that R. Hayyim Abulafia had renewed the community of Tiberias. Desirous of establishing a college in Erez Israel to which Diaspora students would flock in order to hasten the redemption, he set out for Erez Israel together with his closest disciples, among whom were R. David Hasan and R. Shem Tov Gabbai, reaching Leghorn in 1739. There R. Attar's saintly nature soon earned him an eager audience. His home in Leghorn became a center for students who gathered to study under him, and there he preached to large audiences, urging them to repent. R. Moses Franco states that "all the people used to come early in order to find seats and it became impossible to enter because of the multitude." Groups were organized to assist his yeshivah and philanthropists financed the publication of some of his works. He sent proclamations to Jewish communities throughout Italy, urging immigration to Erez Israel, and for that purpose he traveled extensively, visiting Venice, Ferrara, Modena, Reggio, and Mantua. Learning about the epidemics in Erez Israel, some of his disciples became hesitant about making the journey to the Holy Land, but R. Hayyim declared: "It is immaterial to me who comes and who remains; he who has ideals will immigrate and inherit the Land." In 1741, with a group of 30, including Jews from Morocco and young rabbis from Italy, he set sail from Leghorn. R. Moses Franco and R. Abraham Ishmael Sangvinetti describe the voyage in their writings. The group reached Acre in the late summer. Hearing of the epidemics raging in Jaffa and Jerusalem, R. Attar decided to establish a temporary yeshivah in Acre which continued for nearly a year. He then decided to move to Peki'in, attributing the deaths of two of his disciples to the fact that Acre, according to the Talmud, was not within the historic boundaries of Erez Israel. During a visit to Tiberias R. Hayyim Abulafia urged him to reestablish his school there, but when the epidemic subsided, the group set out for Jerusalem.
There Attar established the Midrash Keneset Israel Yeshivah, which had one division for advanced and one for young scholars. He acted as head of the former division which did not study the Talmud with the commentaries, but concentrated on the codes and their connection with the talmudic sources. Special attention was paid to reconciling the decisions of Maimonides with the Talmud. Rishon le-Ziyyon (Constantinople, 1750) whose author was apparently R. David Hasan, is the fruit of those researches. It contains novellae on the Shulhan Arukh, Yoreh De'ah, and Maimonides, as well as a commentary on the Prophets, the five scrolls, and Psalms, Proverbs, and Job. The students indulged in ascetic practices, spending their nights in supplication and prayer for the redemption and peace of Diaspora Jewry. The group also used to prostrate themselves in prayer on holy graves in supplication for the Jewish community. R. H. J. D. Azulai, who studied at the "Midrash," describes it in reverential terms, and in his works he gives details of Attar's customs as well as sermons and explanations which he heard from him. R. Attar passed on approximately a year after settling in Jerusalem.
His masterpiece, the Or ha-Hayyim, commentary on the Pentateuch, and by which name he is often referred to as the "Ohr Ha'Hayyim Ha'Kadosh", has been often republished with the biblical text. It had an extensive circulation in Germany and Poland especially among the Hasidim. In many communities it continues to be studied and read along with the weekly portion of the Torah.