Move Autosave out of /tmp

I question that assertion.

On Linux, Blender will use the value of the environment variable TMP for saving temp files if it is set. If you don’t like the default value, set TMP or set the temporary file path in User Prefs.

On Windows, I believe the environment variable is TEMP, but I can’t check that at the moment.

No offense, but working for 4 hours without saving is not being professional. Getting paid doesn’t change that.

2 Likes

I’ve made a stupid mistake, yes. I know.
And as a matter of fact having made every mistake in the book at least once is for me kind of a defining trait of a professional user.

But I digress. This is about a tool that is supposed to help reduce impacts of mistakes made by users or programmers (crashes can be caused by both). If both were perfect, we wouldt not need autosave.

And I actually made a survey on a mastrodon node with mostly Linux-users and over 50% had their tmp in RAM.

And the majority of the remaining can’t recover files from their tmp location after a system crash.

One even said “hmm. I seriously don’t know of any other application that does that…” after having asked for the reason of my survey.

sorry but u made terrible workflow mistake… and is not blender fault… blender have 2 independent backup system… 1 is in tmp… the other is versioning that u can setup how many u want to keep. basically it works in such way that if u set it to 3 for example it will save original file… + 3 backup copies that are saved… usually the first is last time u hit ctrl+s the next one is i think last 10 min and the next one is 30 min and the next is like 1-3h… i never really digged how it works… but that is in my case usuall timestamp on those files :slight_smile:

Since I usually use the daily compiled version of blender,
Will often crash, so I developed a habit of saving at any time.
However, if you suddenly lose power while saving, the file will be broken and cannot be recovered.

I have encountered this situation before.
I only set up to save two versions, both versions are broken, and I was very depressed at the time.
Fortunately, there is a file that is not very far away from the auto-save file.

The saved function does not know if it can be optimized to avoid damage to the original file when the power is off.

I don’t really like auto-save. When the scene is very large, saving it on a mechanical hard drive will make the computer slow.
I think Blender especially needs a function like zbrush and maya that can be automatically saved in the event of a crash, which can largely avoid the user’s loss and reduce the risk of serious bugs.

I feel like this is a non-issue, seeing that you can just set it up once in your preferences and be done with it.
Whenever I (re-)install a {new) version, I just set it up to my scratch drive.

1 Like

I just want to point out the point of an autosave.
That is, to protect users in the case of a crash.

Many crashes impact the entire system (eg, power loss, catastrophic overheat, angry chainsaw attack). That is a problem. However, autosave ensures that you don’t lose much work. Even if you don’t save often (easy to do if you don’t have the right habits), you won’t lose a ton of work.
By saving to /tmp/, blender is making its autosave worse than useless at protecting data loss from total system crashes. I work with a graphics card that sometimes dies without warning. I know that blender has an autosave, and so I set my interval to be low and expected it to work without me needing to save frequently. When my card recently went down, I restarted my computer, expecting Blender to have autosaved. Except that, because of this issue, the autosave had been deleted. It only served to lure me into a false sense of security.

This problem has a ridiculously simple solution. Save to /var/tmp instead of /tmp. /var/tmp files are persistent through shutdowns, but are still allowed to be cleaned. This change would only help: there is no situation in which it hurts the user. It would literally take less time for someone to change the destination directory to /var/tmp than it would for someone else to write about why it is the responsibility of the user to change this folder every time they boot up.

3 Likes

I cannot stress this enough, but this is not a place to put blame.

  • I know it’s possible to change the deafult.
  • I know it’s possible to save.
  • I know it’s better to not rely on autosaves.
  • … I know blender is not a terrible software because of that choice.

But my point remains:
It’s a very odd choice, because it makes Autosaves voulnerable to system crashes and it is not compliant with software standards and changing that deafult will probably improve the usefulness of this feature.

1 Like

So what if someone makes a mistake one time because of having a hard day? This happened to me today and I lost 8hrs of work. The purpose of autosave is to automatically save not save to tmpfs which may as well be /dev/null. My battery backup also failed.

In Linux /tmp folder is volatile. A kernel panic, power outage, or a system reboot will mean loss of files.
On Linux Trash system should be used by default in Blender. Also for Trash system you will surely have a very accessible icon/widget somewhere by default on any Linux distro. Added to this is that you can set the expiration date for files in Trash system, so that they are automatically deleted according to their age.

I also just lost work because of this bug. It shows a lack of understanding of Linux to save important data to /tmp. It’s in the name: temporary.

I filed a bug for this here: ⚓ T93843 Blender on Linux saves autosave and session files to /tmp, resulting in data loss on a system crash

2 Likes

But you did not include what your recommendation is for an improved default location. It is easy to understand that the current default is “bad” but it must be replaced with something better. I’m guessing that you don’t agree with the previous comment to change to “/var/tmp”?

1 Like

I updated the bug with a recommendation of where it can be saved, similar to other programs (alongside the save file, when it exists).

It is easy to understand that the current default is “bad”

It isn’t “bad,” it’s bad

As for /var/tmp, I don’t believe I’ve seen any other program do that. It might be viable for the case where no save file exists, but when it does (most of the time), it can be saved alongside it, like similar programs

Not sure why you’d get pedantic for something as silly as whether this one word was quoted for emphasis, quotation, “scare quote”, or irony by someone trying to help you. LOL

1 Like

Because developers and established users usually get sassy when you report something is wrong with default behavior. I thought you were being sassy, as if it’s up for debate whether it’s bad that hours of work can be lost from this. Keep in mind, people get pissed off when they lose work

Regardless, I updated the bug and I don’t think a discussion on tone is worthwhile. I think saving files alongside the current save may work, but there are probably other solutions too.

Hi. Linux user for many years here. This is what I had mentioned above about the Trash/recycle bin on Linux.

The Trash/recycle bin is more visible and much more accessible to the user than any /tmp or /var/tmp folders.

What I am not sure is if in all distros Trash location is the same, and if there is a common environment variable to invoke Trash.
The location for the user is usually “~/.local/share/Trash/files”

Bottom Line Up Front: If you don’t like the default, change it. There is no way a single default will make everyone happy.

usually is the important word here. When bad things happen, we need a place we can write to, one that is both guaranteed to exist AND be writable by Blender. On Linux, both /tmp and /var/tmp exist, the difference being that /tmp is traditionally cleared at boot time. Does this make /var/tmp a better default? Not really, since if the system crashed, there are no guarantees that a complete and usable .blend got written.

If you do not like a default setting, take a few minutes to change it. In this particular case, you can either change the location of the temp dir OR you can set your system to not clear /tmp on boot. Yes, that is a setting too!

For my part, I have been using Linux Trash for Blender temp files for years. But here we are discussing about usability, where the best option should be chosen by default. And a volatile /tmp folder for recovery files is the worst option for Blender to choose by default.

I clarify that I just said “usually” because I am an old Linux user, but not a Linux Pro user, so I cannot guarantee that this is always the case in all distros. Anyway I suppose that Blender developers could make Blender look for folders to exist, then choose the folder that has been found for Temporary Files.

2 Likes

This link will guide you, however be sure to check it regularly so that it does not get bigger than you will like after changing it and losing the self-cleaning functionality. The link is for blender 2.79 but it is pretty much same for subsequent versions, as in the screenshot attached.
A guide from the Blender manual on changing your temp location.

but why not simply ~/.cache like quite literally any other software does it?

Only if it will be compliant with the XDG Base Directory spec. so in this case it should be in $XDG_CACHE_HOME

1 Like