$ cvs export -r HEAD module
cvs [export aborted]: cannot export into working directory
这是因为环境变量CVSROOT后缀多了一个"/"的缘故,例如$CVSROOT='/home/cvs/',象这样就没有问题了:
$ export CVSROOT='/home/cvs'
$ echo $CVSROOT
/home/cvs
$ cvs export -r HEAD module
写了一个每日自动导出项目的脚本,这个应该已经满世界都是了吧 :P
#!/bin/sh
# This script export a module of cvs to /data3/cvsback and compress it
modulename='module'
todayofmonth=$modulename"_"`date | date +%d -d -`
bzipfilename=$todayofmonth".tar.bz2"
exportpath='/data3/cvsback/'
cvsroot='/data1/cvs'
if !(test -d $exportpath)
then
mkdir $exportpath
fi
if test -e $exportpath$bzipfilename
then
rm -f $exportpath$bzipfilename
fi
if (test -d $exportpath$modulename)
then
rm -rf $exportpath$modulename
fi
export CVSROOT=$cvsroot
cd $exportpath
cvs export -d $modulename -r HEAD $modulename
tar -cpf $todayofmonth".tar" $modulename
bzip2 $todayofmonth".tar"
rm -rf $modulename