drush/Commands/PolicyCommands.php
public function rsyncValidate(CommandData $commandData) {
    if (preg_match("/^@prod/", $commandData->input()->getArgument('target'))) {
      throw new \Exception(dt('Per !file, you may never rsync to the production site.', ['!file' => __FILE__]));
    }
  }
public function rsyncValidate(CommandData $commandData) {
    if (preg_match("/^@prod/", $commandData->input()->getArgument('target'))) {
      throw new \Exception(dt('Per !file, you may never rsync to the production site.', ['!file' => __FILE__]));
    }
  }
public function rsyncValidate ( CommandData $ commandData ) { if ( preg_match ( "/^@prod/" , $ commandData -> input ( ) -> getArgument ( 'target' ) ) ) { throw new \ Exception ( dt ( 'Per !file, you may never rsync to the production site.' , [ '!file' => __FILE__ ] ) ) ; } }
Limit rsync operations to production site.

@hook validate core:rsync

@throws \Exception
Limit rsync operations to production site .