Replace

The replace option specifies whether to overwrite existing files on your workstation, or to prompt you for your selection when you restore or retrieve files.

Important: The replace option does not affect recovery of directory objects. Directory objects are always recovered, even when specifying replace=no. To prevent overwriting existing directories, use the filesonly option.

You can use this option with the following commands:

  • restore
  • restore backupset
  • restore group
  • retrieve
Note: Replace prompting does not occur during a scheduled operation. If you set the replace option to prompt, the backup-archive client skips files without prompting you during a scheduled operation.
Mac OS X operating systemsWindows operating systemsOracle Solaris operating systemsLinux operating systemsAIX operating systems

Supported Clients

This option is valid for all clients. The IBM Spectrum® Protect API does not support this option.

Options File

Mac OS X operating systemsOracle Solaris operating systemsLinux operating systemsAIX operating systemsPlace this option in the client user-options file (dsm.opt). You can set this option on the Restore tab, Action for files that already exist section of the Preferences editor.

Windows operating systemsPlace this option in the client options file (dsm.opt). You can set this option on the Restore tab, Action for files that already exist section of the Preferences editor.

Syntax

Read syntax diagramSkip visual syntax diagramREPlace PromptAllYesNo

Parameters

Prompt
For nonscheduled operations, you specify whether to overwrite existing files. For scheduled operations, existing files are not overwritten and no prompts are displayed. This is the default.
Mac OS X operating systemsOracle Solaris operating systemsLinux operating systemsAIX operating systemsAll
Mac OS X operating systemsOracle Solaris operating systemsLinux operating systemsAIX operating systemsAll existing files are overwritten, including read-only files. If access to a file is denied, you are prompted to skip or overwrite the file. No action is taken on the file until there is a response to the prompt.
Windows operating systemsAll
Windows operating systemsAll existing files are overwritten, including read-only files. All locked files are replaced when the system is rebooted. If access to a file is denied, you are prompted to skip or overwrite the file. No action is taken on the file until there is a response to the prompt.
Yes
Existing files are overwritten, except read-only files. For nonscheduled operations, you specify whether to overwrite existing read-only files. For scheduled operations, existing read-only files are not overwritten and no prompts are displayed. If access to a file is denied, the file is skipped.
Windows operating systemsNo
Windows operating systemsExisting files are not overwritten. No prompts are displayed.

Mac OS X operating systemsNote: When restoring or retrieving files with the replace option set to no, existing files are not overwritten, but existing directories are overwritten. To leave existing directories intact during a restore or retrieve operation, select the Options > All selected files and directories > Files only from the backup-archive client GUI.

Mac OS X operating systemsOracle Solaris operating systemsLinux operating systemsAIX operating systemsNo
Mac OS X operating systemsOracle Solaris operating systemsLinux operating systemsAIX operating systemsExisting files are not overwritten. No prompts are displayed.
Windows operating systemsNote: You can choose to replace locked files when the system is rebooted. The client cannot perform an in-place restore of active files. However, it stages restored versions of active files for replacement during the next reboot, except for files containing named streams, sparse files, and directories. You can only restore these files if they are unlocked.

Examples

Options file:
replace all
Command line:
-replace=no

This option is valid on the initial command line and in interactive mode. If you use this option in interactive mode, it affects only the command with which it is specified. When that command completes, the value reverts to the value at the beginning of the interactive session. This is the value from the dsm.opt file unless overridden by the initial command line or by an option forced by the server.