自动化SVN更新 [英] Automating svn update

查看:176
本文介绍了自动化SVN更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我经常ssh方式连接到服务器,切换到一个特定的目录和使用svn更新

I'm frequently sshing into a server, switching to a specific directory and running svn-update

我在想,有可能是自动这是一个非常简单的方法,所以我可以简单特定子目录,当我运行该脚本,它会通过SSH登录,cd到正确的目录并运行svn更新。

I'm thinking that there's probably a very easy way to automate this, so I can simple specific a subdirectory when I run the script and it'll login via SSH, cd to the right directory and run svn-update.

这是对Capistrano的工作或可能一个简单的bash脚本做的工作?

Is this a job for capistrano or could a simple bash script do the job?

推荐答案

听起来像是一个工作的cron 。执行的crontab ,并添加一个条目像这样:

Sounds like a job for cron. Execute crontab, and add an entry like so:


#min hour date month day command
 0   *    *    *     *   ssh user@host '(cd path/to/working/copy; svn update)' 

您可能需要设置 SSH密码认证使用ssh代理,使其赢得了 ŧ提示。

You may need to set up ssh passwordless authentication with ssh-agent so that it won't prompt.

编辑(每下面的注释):

EDIT (per comments below):

假设你有足够的权限这样做,运行

Assuming you have sufficient privileges to do so, run


ssh user@host crontab -e

然后添加一个条目,像这样:

Then add an entry like so:


#min hour date month day command
 0   *    *    *     *   (cd path/to/working/copy; svn update)

您可以忽略编辑以上的部分,除非您的服​​务器不允许你使用cron。

You can ignore the part above the edit, unless your server doesn't allow you to use cron.

这篇关于自动化SVN更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆