Autosave, Crash Recovery and Backups

To minimize loss of work in the event of a crash, j autosaves each modified buffer whenever there is no user activity for a minimum of two seconds. This has no effect on the file you're editing; modified buffers are written out to temporary files in j's autosave directory (which is normally ~/.j/autosave on Unix or C:\.j\autosave on Windows, but see below).

Whenever you explicitly save a file, the corresponding autosave file is deleted. When j exits normally, all the autosave files are deleted. If a crash occurs, the autosave files will still be around when you restart j, and j will ask you, one by one, if you want to recover the files in question. If you say yes, the file will be restored from the corresponding autosave file. If you say no, j will offer to delete the autosave file. If you choose not to delete the autosave file, it will remain in the autosave directory for perusal and disposition at your leisure.

Whenever you explicitly save a file, a backup of the file is written to the backup directory, which by default is a directory called backup located in the home directory of the current user (i.e. ~/backup on Unix).

On Windows, the home directory of the current user normally defaults to C:\ (the default is actually the root directory of the first writable drive, excluding A: and B:), so the default backup directory on Windows is normally C:\backup.

You can specify a different home directory by starting j with the --home command line option:

    j --home=C:\ArmedBear
In this case your home directory, as far as j is concerned, will be C:\ArmedBear, the .j directory will be C:\ArmedBear\.j, autosave files will be stored in C:\ArmedBear\.j\autosave, and the default backup directory will be C:\ArmedBear\backup.

You can specify the location of the backup directory separately by setting the backupDirectory property in your preferences file:

The backup file (in the backup directory) always has the same name as the original file.

It's a good idea to visit your backup directory occasionally and clean it out; there is no mechanism in j to do this automatically.