charlottevast.blogg.se

Sync folders action
Sync folders action






sync folders action

The After action will receive similar parameters as Before plus the actual directory that was This can be used to create point-in-time snapshots - see examples below. The action command can modify the contents source directory in place or it can request other directoryīe snapshotted instead by printing a line to standard output: KOPIA_SNAPSHOT_PATH=

sync folders action

When kopia invokes Before actions, it passes the following parameters: Variable On Unix, if the script has #! prefix, it will be executed directly, bypassing the /bin/sh shell.

  • On Windows: cmd.exe /c C:\path\to\temporary\script\file.cmd.
  • On Linux and macOS: sh -e /path/to/temporary/script/file.sh.
  • Scripts stored like this will be temporarily extracted to a local directory and executed using a shell command, which is: To prevent binaries from being stored, the maximum script length can be up to 32000 characters. This can be overridden using -action-command-timeout: $ kopia policy set /some/dir -action-command-timeout=180s \įinally, the action command itself can be stored in a repository, when -persist-action-script is passed. before-folder-action /usr/local/bin/notifier.shĮach action has an associated timeout (by default 5 minutes), which specifies how long it will be allowed to run before Kopia kills the process. Using -action-command-mode, for example: $ kopia policy set /some/dir -action-command-mode=async \ NOTE: Unlike all other policy options, -before-folder-action and -after-folder-action are not inherited and must be set explicitly on target folders, while -before-snapshot-root-action and -after-snapshot-root-action are inherited from their parents and can be set at global, host, user or directory level.Īctions can be essential (must succeed, default behavior), optional (failures are tolerated) or async (kopia will start the action but not wait for it to finish). $ kopia policy set /some/dir -after-snapshot-root-action /path/to/command $ kopia policy set /some/dir -before-snapshot-root-action /path/to/command $ kopia policy set /some/dir -after-folder-action /path/to/command To set the script for a directory we can use kopia policy set on a directory.įor example: $ kopia policy set /some/dir -before-folder-action /path/to/command When using KopiaUI, actions can be enabled globally by editing your nfig (it is located in the Config File location in KopiaUI under Repository) and change "enableActions": false to "enableActions": true. force-disable-actions to enable or disable actions for the single snapshot session.

    sync folders action sync folders action

    You can override that decision when taking snapshot by passing -force-enable-actions or.When connecting to repository you can pass -enable-actions which will enable actions globally.When using Kopia CLI, actions can be enabled globally at connection time or individually per snapshot: To reduce the security risk, actions are an opt-in feature and are not enabled by default. snapshotting databases or virtual machines as part of taking a snapshotĪctions can optionally modify the directory to be snapshotted or redirect upload to another directory (typically a mountpoint representing filesystem snapshot).creating snapshots of filesystems that support it (e.g.Starting with v0.8 Kopia supports running custom user-provided commands or scripts before and after snapshot root and also before/after individual folders as they get snapshotted.








    Sync folders action