Skip to content

move

!move

Category: files

Move/rename a file on the target. Optionally backs up an existing destination first. Supports force-overwrite and post-move permission/ownership changes.

Parameters

NameTypeRequiredDescription
srcpathyesRemote source path (must exist).
destpathyesRemote destination path (parent dir must exist).
modestringnoOctal permission string applied via chmod after the move.
ownerstringnoOwner applied via chown after the move.
groupstringnoGroup applied via chown after the move.
backupboolnoCopy the existing dest to a timestamped .backup before overwriting.
forceboolnoOverwrite an existing destination instead of reporting matched.

Examples

- !move
  src: /etc/app/app.conf.new
  dest: /etc/app/app.conf
  backup: true
  mode: '0o640'