在 Windows 7 中使用 Rsync 部署 Symfony Projekt - 权限问题
我正在拼命尝试使用 Rsync 部署我的 Symfony 应用程序。
我安装了 cwRsync 并且它有点工作,至少 SSH 可以。我的应用程序位于 E:\xampp\htdocs\MyProject。
Rsync 实际上确实在我的服务器上创建了一个目录,但除此之外,我只收到权限错误。
现在,这似乎是一个常见问题,但是我无法实施任何解决方案,例如: cwRsync 在 Windows 7 上忽略“nontsec”
我将 cwRsync 安装到以下目录: c:\cwrsync
我的问题:我的 fstab 文件需要是什么样子,我什至必须把它放在哪里?这个问题还有其他解决方案吗?
提前致谢!
I am desperetly trying to deploy my Symfony app with Rsync.
I instally cwRsync and it somewhat works, at least SSH does. My app is located in E:\xampp\htdocs\MyProject.
Rsync actually does create one directory on my Server but other than that, I only get permission errors.
Now, this seems to be a common problem, however I am not able to implement any solutions, such as this one:
cwRsync ignores "nontsec" on Windows 7
I installed cwRsync to the following directory: c:\cwrsync
My Question: what does my fstab file need to look like, and where do I even have to put it? Are there any other solutions to this problem?
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我已经发布了你提到的那个问题。以下是我最终让 symfony
project:deploy
在 Windows 7 上工作的方法(它需要对 symfony 进行一些破解,因此它可能不是最佳解决方案)。使用此解决方案,您不需要安装完整的 cygwin,只需要 cwRsync。在您的
fstab
中,添加以下行(fstab 应位于[cwrsync install dir]\etc
下):这实际上将“C:\wamp\www”映射到您的 Windows 上cygwin 的文件系统为“/www”。
修改
symfony/lib/task/sfProjectDeployTask.class.php
:这允许您在
properties.ini
中指定额外的src
字段:使 Windows 和 cygwin 之间的整个文件系统映射定义更加清晰。 Cygwin(和 cwRsync)比 Windows 路径更好地理解 Unix 路径(即
/www
与C:/wamp/www
),因此这样做可以使一切正常工作。I'd posted that question you referred to. Here's what I ended up doing to get symfony
project:deploy
to work from Windows 7 (it required hacking symfony a bit, so it may not be the most optimal solution). With this solution, you don't need fullblown cygwin installed, you just need cwRsync.In your
fstab
, add this line (fstab should be located under[cwrsync install dir]\etc
):This essentially maps "C:\wamp\www" on your windows filesystem to "/www" for cygwin.
Modify
symfony/lib/task/sfProjectDeployTask.class.php
:This allows you to specify an additional
src
field inproperties.ini
:Doing this makes the whole filesystem mapping between windows and cygwin much more clearly defined. Cygwin (and cwRsync) understand unix paths much better than windows paths (i.e.
/www
vs.C:/wamp/www
), so doing this makes everything just work.运行脚本
我认为 Rsync 在 Windows 和 Linux 之间同步期间总是会破坏您的文件权限。
您可以非常轻松地创建一个脚本,在同步后遍历您的文件并使用 chmod 重置文件权限。
Run a Script
I think Rsync always breaks your file permissions during sync between Windows and Linux.
You can quite easily create a script that goes through your file after a sync and resets the file permissions using chmod though.