Hi,

I just tried using drush rsync for the first time and I keep getting permission errors like:

rsync: failed to set times on "/var/www/sites/xxx": Operation not permitted (1)
rsync: mkstemp "/var/www/sites/xxx" failed: Permission denied (13)

All of my drupal files are set as www-data and I'm running drush rsync as a different non-root user. Is that the problem? Should I run rsync as a different user? What does everyone else do?

Thanks,
Bob

Comments

greg.1.anderson’s picture

Status: Active » Fixed

On the live site, my web files are owned by www-admin (not the webserver user), and their group is www, which the webserver belongs to, so I chmod g+w things that need to be written by the webserver.

On the dev site, my web files are owned by the user I log in as, and again the group is www.

I insure that I preserve permissions but not owner when I rsync between dev and live. That way I do not need to sudo on dev.

Littlebob’s picture

Greg, thanks for getting back to me so quickly. What rsync options do you use to keep permissions but not the owner?

greg.1.anderson’s picture

From my drushrc.php:

$command_specific['rsync'] = array('mode' => 'rlptz');
$command_specific['sql-sync'] = array('mode' => 'rlptz');

In my remote site alias, 'remote-user' => 'www-admin', so the user automatically changes when I sync from dev to live.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.