xforty / vagrant-drupal

Template repo for a new drupal project built on top of a vagrant vm.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Stale sql-sync-old.sql collide with different users.

pearcec opened this issue · comments

These files are created in /tmp. When I tried to do a drush sql-sync as a different user it failed. Can we do something with our aliases file?

-rw-r--r-- 1 21494861 2012-05-30 08:16 sql-sync-old.sql
-rw-r--r-- 1 21494861 2012-05-30 07:59 sql-sync-prod.sql
-rw-r--r-- 1 21494861 2012-05-30 08:14 sql-sync-test.sql

Those sql-sync filenames used to have the project name (or something like that) in them. I removed those specifics to help limit the number of lines that needed to be touched by the developer. Perhaps we could just set a $project_name variable at the top and use it throughout the aliases file?

$project_name = 'example.com';
$aliases['dev'] = array(
  'uri' => "dev.$project_name",
  'root' => '',
  'remote-host' => '',
  'remote-user' => '',
  'path-aliases' => array(
    '%files' => 'sites/default/files',
    '%dump' => "/tmp/sql-sync-dev.$project_name.sql",
  ),
);

Meh...I'm not thrilled with that approach. Getting too cute for something that doesn't happen too often. I'm inclined to just add the project name back into the dump filenames.

Looking at the permissions on the remote server they are 644. So I think it is more appropriate to set the %dump to /home/username/tmp/sql-sync-env.sql.

I am going to update the project to use $project_name. Makes more sense IMO.

15784f3

If we specify a tilde for '%dump' => '~/tmp/sql-sync-test.sql', will drush expand the tilde? If that doesn't work, we should add a placeholder to promote best practice for %dump paths. Such as '%dump' => '<remote_user_home>/tmp/sql-sync-test.sql'.

Does the ~/tmp folder get cleaned up eventually like /tmp?

no it won't get cleaned up. But shouldn't matter since the file gets overwritten. The ~ is a shellism. So if that path is getting tossed to a shell it will work, otherwise I doubt it would.

----- Original Message -----
From: "David King" reply@reply.github.com
To: "Christian Pearce" pearcec@xforty.com
Sent: Thursday, June 14, 2012 8:23:12 AM GMT -05:00 US/Canada Eastern
Subject: Re: [vagrant-drupal] Stale sql-sync-old.sql collide with different users. (#52)

If we specify a tilde for '%dump' => '~/tmp/sql-sync-test.sql', will drush expand the tilde? If that doesn't work, we should add a placeholder to promote best practice for %dump paths. Such as '%dump' => '<remote_user_home>/tmp/sql-sync-test.sql'.

Does the ~/tmp folder get cleaned up eventually like /tmp?


Reply to this email directly or view it on GitHub:
#52 (comment)

xforty technologies
Christian Pearce
888-231-9331 x1119
http://xforty.com

I added /home/<remote_user> to all the %dump paths in aliases.drushrc.php 2cf0f11