I just knocked this up for you. You could always look into maya's own incremental save options aswell.
A
global proc string saveTmpFile()
{
string $currentname = `file -q -exn`;
//have some way of creating a temp name here incremental would be better
int $rnd = rand(1000, 9999);
string $tempName = `substitute "\.ma" $currentname ("_" + $rnd + "_tmp.ma")`;
//save as the neew temp name
file -rename $tempName;
file -f -save -options "v=0" -type "mayaAscii";
//rename back to our initial name
file -rename $currentname;
return($tempName);
}
Technical Director - Framestore
Currently working on: Your Highness
IMDB