function drush_policy_core_rsync_validate

8.0.x policy.drush.inc drush_policy_core_rsync_validate($source = NULL, $destination = NULL)
master policy.drush.inc drush_policy_core_rsync_validate($source = NULL, $destination = NULL)

Implements drush_hook_COMMAND_validate().

We can also limit rsync operations to production sites.

File

examples/policy.drush.inc, line 37
Example policy commandfile. Modify as desired.

Code

function drush_policy_core_rsync_validate($source = NULL, $destination = NULL) {
  if (preg_match("/^@prod/", $destination)) {
    return drush_set_error('POLICY_DENY', dt('Per examples/policy.drush.inc, you may never rsync to the production site.'));
  }
}