Moed Katan2: 2
וְכֵן מִי שֶׁהָיָה יֵינוֹ בְּתוֹך הַבּוֹר וְאֵרְעוֹ אֵבֶל אוֹ אֹנֶס, אוֹ שֶׁהִטְעוּהוּ פוֹעֲלִים — זוֹלֵף וְגוֹמֵר וְגָף כְּדַרְכּוֹ; דִּבְרֵי רַבִּי יוֹסֵי.  רַבִּי יְהוּדָה אוֹמֵר: עוֹשֶׂה לוֹ לִמּוּדִים בִּשְׁבִיל שֶׁלֹּא יַחֲמִיץ.
Similarly, one whose wine was in the vat and then mourning befell him, or an accident [befell him], or [his] workers misled him, may pour [the wine into barrels], complete [its processing], and seal [the barrels] in his usual manner. This is the opinion of R' Yose.  R' Yehudah says: He may cover [the barrels] with boards so that [the wine] does not sour.
Moed Katan2: 3
מַכְנִיס אָדָם פֵּרוֹתָיו מִפְּנֵי הַגַּנָּבִים, וְשׁוֹלֶה פִשְׁתָּנוֹ מִן הַמִּשְׁרָה בִּשְׁבִיל שֶׁלֹּא תֹאבַד, וּבִלְבַד שֶׁלֹּא יְכַוֵּן אֶת מְלַאכְתּוֹ בַמּוֹעֵד. וְכֻלָּן אִם כִּוְּנוּ מְלַאכְתָּן בַּמּוֹעֵד — יֹאבֵדוּ.
A person may bring in his fruit because of thieves, and remove his flax from the soaking pond so that it does not become ruined, provided he does not plan his work for [Chol] HaMoed. In all these cases, if they planned their work for [Chol] HaMoed, it shall be forfeited.