分类:
2008-05-06 14:02:00
Use Import Tool (Tool release with DBgate tarball) Can import OSS Media Asset Data into DRM Server DB
l Config import Tool
Login on DBGate Server
#cd /usr/local/rss/bin
#vi import.conf
DBGATE_SERVER=
SOAP_PORT=5090
CSP_ID=CSP02
CSP_URL=
LSP_ID=LSP02
LSP_URL=lsp_url
CORRELATE_ID=000002
XML_URL=ftp://wacos:wacos@
l Execute import Tool
cd /usr/local/rss/bin
./importtool
Notes:Media Asset Data need import into DRM Server DB include: VOD,Channel,PVOD,Series,ChannelPackage,SVOD,so need configure import.conf each XML File then execute importtool to import Data to lsdb.
l Check Asset Data in DRM Server DB(lsdb)
mysql> select count(*) from service;
mysql> select count(*) from service_package;
mysql> select count(*) from channel;
mysql> select count(*) from vod;
mysql> select count(*) from vod_content;
# cat /usr/local/rss/bin/test
#!/bin/sh
for string in `ls /root/data/Channel`
do
killall -9 importtool
cd /usr/local/rss/bin
cat data.conf > import.conf
fullstring=XML_URL=ftp://wacos:wacos@10.50.101.101:21//opt/wacos/ctms/ctmsexporter/data/Channel/$string
echo "$fullstring">> import.conf
sleep 1
./importtool &
sleep 5
done
for string in `ls /root/data/Package`
do
killall -9 importtool
cd /usr/local/rss/bin
cat data.conf > import.conf
fullstring=XML_URL=ftp://wacos:wacos@10.50.101.101:21//opt/wacos/ctms/ctmsexporter/data/Package/$string
echo "$fullstring">> import.conf
sleep 1
./importtool &
sleep 5
done
for string in `ls /root/data/Program`
do
killall -9 importtool
cd /usr/local/rss/bin
cat data.conf > import.conf
fullstring=XML_URL=ftp://wacos:wacos@10.50.101.101:21//opt/wacos/ctms/ctmsexporter/data/Program/$string
echo "$fullstring">> import.conf
sleep 1
./importtool &
sleep 1
done
解释:
for string in `ls /root/data/Channel`
do
因为importtool不会退出,需要在运行先杀死该进程
killall -9 importtool
cd /usr/local/rss/bin
配置文件的不变部分
cat data.conf > import.conf
配置文件的变化部分,重要在字符串的连接。
fullstring=XML_URL=ftp://wacos:wacos@10.50.101.101:21//opt/wacos/ctms/ctmsexporter/data/Channel/$string
echo "$fullstring">> import.conf
sleep 1
./importtool &
暂停以确保程序运行完毕。
sleep 5
done
data.conf的配置文件如下:
# cat /usr/local/rss/bin/data.conf
DBGATE_SERVER=http://
SOAP_PORT=5090
CSP_ID=IMSP
CSP_URL=
LSP_ID=DRM
LSP_URL=lsp_url
CORRELATE_ID=000002
另外需要把/opt/wacos/ctms/ctmsexporter/data目录复制到本机/root/data