# backup(2m)

[Home] [Commands] [Variables] [Macro-Dev] [Glossary]

## NAME

backup - Automatic file backup of last edit

## SYNOPSIS

backup Mode

B - mode line letter.

## DESCRIPTION

backup mode, when enabled, performs an automatic backup of the last edit when a save file operation is performed. The backup file name is derived from the base file name and is written into the same directory as the source file, the backup file name can be obtained from the variable $buffer-backup(5).

On unlimited file name length systems the naming convention used depends on bit 0x400 of variable $system(5), if this bit is set then the system simulates a DOS style 8.3 file naming convention. If this bit is clear then variable $kept-versions(5) can be used to create multiple backup files.

Where an existing backup file already exists, then the old backup file is removed and replaced by the newer backup file. The naming convention for backup files is defined as follows:-

On unlimited length file name systems (UNIX and some Windows systems) with a single backup file, the following file naming conventions are used for file `xxxxx`:

`xxxxx -> xxxxx~`

On unlimited length file name systems with multiple backup files, the following file naming conventions are used for file `xxxxx`:

`xxxxx -> xxxxx.~?~`

Where `?` is the backup number, the most recent backup file is always "`.~0~`".

On systems with an `xxxxxxxx.yyy` file name (MS-DOS etc), the following file naming conventions are used:

`xxxxxxxx -> xxxxxxxx.~~~`
`xxxxxxxx.yyy -> xxxxxxxx.yy~`
`xxxxxxxx.yyyy -> xxxxxxxx.yyy~`

The environment variables $MEBACKUPPATH(5) and $MEBACKUPSUB(5) can be used to modify this behaviour.

## NOTES

backup is enabled by default.

Reference should also be made to undo(2) which allows previous edits to be removed. Also see $auto-time(5) and autosv(2m) which allows a timed backup of a running edit to be periodically performed.

The user is warned to be extra careful if files ending in '`~`' or '`#`'s are used, it is advisable to disable backup creation (see global-mode(2)) and auto-saving (`$auto-time = 0`). The author denies all responsibility (yet again) for any loss of data! Please be careful.

## SEE ALSO

Operating Modes, $buffer-backup(5). $system(5), $kept-versions(5), $MEBACKUPPATH(5), $MEBACKUPSUB(5), buffer-mode(2), global-mode(2), undo(2m), autosv(2m), $auto-time(5).

(c) Copyright JASSPA 2009
Last Modified: 2009/08/29
Generated On: 2009/10/12

</HMTL>