我想通过ssh在Cygwin中创build卷影副本(vshadow 2.2):
$ ./vshadow.exe -p -nw C: (...) - Setting the VSS context to: 0x00000019 Creating shadow set {a5e0883e-9485-4243-8276-1ac7c569ab6a} ... - Adding volume \\?\Volume{218a908d-1e3f-11df-a215-806e6f6e6963}\ [C:\] to the shadow set... Creating the shadow (DoSnapshotSet) ... ERROR: COM call "m_pVssObject->DoSnapshotSet(&pAsync)" failed. - Returned HRESULT = 0x80070005 - Error text: Access is denied.
我想这是因为Cygwin运行的本地Windows用户cyg_server没有某种types的权限。
我试过的东西:
/tracing 。 在这个失败点上,我看不出有什么帮助 cyg_server完全控制的目录。 不用找了。 cyg_server成为Domain Admins的成员。 不用找了。 没有-nw开关的vshadow,取而代之:
$ ./vshadow.exe -p C:(…)
我怎样才能使用公钥validationSSH快照?
更新 :我发现这个线程从2007年提到,你不能如果你使用公共密钥身份validation。 我已经validation,如果我重命名我的id_rsa文件并使用密码login,它可以工作(无论是否使用-nw开关)。但是我需要使用pubkeyauthentication才能创build备份脚本。 作者没有提到为什么会这样,但我想这在过去的六年里还没有被修复……有没有解决方法?
你是否可以使用公钥进行正常的复制/连接?
你可能也想检查一下backupcentral网站上的post,其中一个用户发布了他使用Windows 2003设置的内容以及他使用的脚本。
使用cygwin,公钥和rsync来备份Windows 2003
关键在于使用at命令来运行NT AUTHORITY\SYSTEM因为由于某种原因使用公钥而不是密码login会让你像Cygwin下的其他用户那样运行。 引用:
# Launches passed input via 'at' to get around $USERNAME=SYSTEM # problem under ssh login where the shell lacks permsisions to run # commmands like vshadow or dosdev # from a script by Jeffrey J. Kosowsky function at_launch () { local hms wait1 command if [ $3 != "" ] ; then command="${1} ${2} >> ${3}" else command="${1} ${2}" fi set -- $(date +"%H %M %S") h=$((10#$1)) #Note explicitly use base 10 so that 08 and 09 not interpreted as bad octal m=$((10#$2 +1)) #Advance minutes by 1 s=$((10#$3)) wait1=$((60 - $s)) [ $s -gt 55 ] && let "m += 1" "wait1 += 60" # Make sure >5 seconds left [ $m -ge 60 ] && let "m %= 60" "h += 1" #Overflow minutes let "h %= 24" at $h:$m $(cygpath -w $(which bash.exe)) -c "$command" # > /dev/null echo Running '$command' at $h:$m return $wait1 }