简体   繁体   English

使用bash脚本自动提交到Subversion

[英]Auto-commit to Subversion using bash script

I have the following bash script, which is run every 15 minutes by cron. 我有以下bash脚本,由cron每15分钟运行一次。 The idea is that it will add any new files to the repo, then commit all changes: 这个想法是它将所有新文件添加到仓库中,然后提交所有更改:

#! /bin/sh

# Add any new files found in /wc
svn add /wc --force

# Commit all changes to repository
svn commit /wc -m "Auto commit"

The svn add command is throwing an error: svn add命令抛出错误:

svn: '/' is not a working copy

What am I doing wrong? 我究竟做错了什么?

Running svn add /wc --force from command line throws the same error. 从命令行运行svn add /wc --force会抛出相同的错误。

as I tested a second ago, that should work: 正如我第二次测试的那样,它应该可以工作:

svn add --depth=infinity --force /wc/*

I assume /wc is your working copy of the svn repo. 我假设/ wc是svn回购的工作副本。

edit: actually you just need to add /* probably, I think -depth=infinity is set by default. 编辑:实际上,您可能只需要添加/ *,我认为-depth = infinity是默认设置。

Change into the directory (inside the bash script) before running the SVN commands, just with a 在运行SVN命令之前,只需进入一个目录(在bash脚本内)即可。

cd /wc

inside your script. 在您的脚本中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM