Docs/工作-盒子/数据中心签名图片导入TFS.html
2022-10-18 16:59:37 +08:00

182 lines
No EOL
5.8 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="tool" content="leanote-desktop-app">
<title>数据中心签名图片导入TFS</title>
<style>
*{font-family:"lucida grande","lucida sans unicode",lucida,helvetica,"Hiragino Sans GB","Microsoft YaHei","WenQuanYi Micro Hei",sans-serif;}
body {
margin: 0;
}
/*公用文字样式*/
h1{font-size:30px}h2{font-size:24px}h3{font-size:18px}h4{font-size:14px}
.note-container{
width:850px;
margin:auto;
padding: 10px 20px;
box-shadow: 1px 1px 10px #eee;
}
#title {
margin: 0;
}
table {
margin-bottom: 16px;
border-collapse: collapse;
}
table th, table td {
padding: 6px 13px;
border: 1px solid #ddd;
}
table th {
font-weight: bold;
}
table tr {
background-color: none;
border-top: 1px solid #ccc;
}
table tr:nth-child(2n) {
background-color: rgb(247, 247, 249);
}
.mce-item-table, .mce-item-table td, .mce-item-table th, .mce-item-table caption {
border: 1px solid #ddd;
border-collapse: collapse;
padding: 6px 13px;
}
blockquote {
border-left-width:10px;
background-color:rgba(128,128,128,0.05);
border-top-right-radius:5px;
border-bottom-right-radius:5px;
padding:15px 20px;
border-left:5px solid rgba(128,128,128,0.075);
}
blockquote p {
margin-bottom:1.1em;
font-size:1em;
line-height:1.45
}
blockquote ul:last-child,blockquote ol:last-child {
margin-bottom:0
}
pre {
padding: 18px;
background-color: #f7f7f9;
border: 1px solid #e1e1e8;
border-radius: 3px;
display: block;
}
code {
padding: 2px 4px;
font-size: 90%;
color: #c7254e;
white-space: nowrap;
background-color: #f9f2f4;
border-radius: 4px;
}
.footnote {
vertical-align: top;
position: relative;
top: -0.5em;
font-size: .8em;
}
hr {
margin:2em 0
}
img {
max-width:100%
}
pre {
word-break:break-word
}
p,pre,pre.prettyprint,blockquote {
margin:0 0 1.1em
}
hr {
margin:2em 0
}
img {
max-width:100%
}
.sequence-diagram,.flow-chart {
text-align:center;
margin-bottom:1.1em
}
.sequence-diagram text,.flow-chart text {
font-size:15px !important;
font-family:"Source Sans Pro",sans-serif !important
}
.sequence-diagram [fill="#ffffff"],.flow-chart [fill="#ffffff"] {
fill:#f6f6f6
}
.sequence-diagram [stroke="#000000"],.flow-chart [stroke="#000000"] {
stroke:#3f3f3f
}
.sequence-diagram text[stroke="#000000"],.flow-chart text[stroke="#000000"] {
stroke:none
}
.sequence-diagram [fill="#000"],.flow-chart [fill="#000"],.sequence-diagram [fill="#000000"],.flow-chart [fill="#000000"],.sequence-diagram [fill="black"],.flow-chart [fill="black"] {
fill:#3f3f3f
}
ul,ol {
margin-bottom:1.1em
}
ul ul,ol ul,ul ol,ol ol {
margin-bottom:1.1em
}
kbd {
padding:.1em .6em;
border:1px solid rgba(63,63,63,0.25);
-webkit-box-shadow:0 1px 0 rgba(63,63,63,0.25);
box-shadow:0 1px 0 rgba(63,63,63,0.25);
font-size:.7em;
font-family:sans-serif;
background-color:#fff;
color:#333;
border-radius:3px;
display:inline-block;
margin:0 .1em;
white-space:nowrap
}
.toc ul {
list-style-type:none;
margin-bottom:15px
}
</style>
<!-- 该css供自定义样式 -->
<link href="../leanote-html.css" rel="stylesheet">
</head>
<body>
<div class="note-container">
<h1 class="title" id="leanote-title">数据中心签名图片导入TFS</h1>
<div class="content-html" id="leanote-content"><div><div><h1>数据中心签名图片导入TFS</h1><p>操作的服务器是&nbsp;172.16.3.51<br></p><p><br></p><p>2015年的数据已经全部导入tfs2015年之前的签名只存在数据中心。</p><p>由dba导出订单号以及签名的路径文件中间以逗号分隔格式如下</p><pre>[root@mfsmaster tfs_sign]# head TBL_TXN_VOUCHER_INF-1504-05-1.txt
20150517000024554032,/images/sign/137007452736950046.png
20150517000024554033,/images/sign/137007244844566617.png
20150517000024554041,/images/sign/137007333019517925.png
20150517000024554058,/images/sign/137007152124967579.png
20150517000024554060,/images/sign/137007553315054730.png
20150517000024554066,/images/sign/137007434228617749.png</pre><h2>过滤掉签名图片大小为0</h2><p>历史遗留问题原来有一些签名图片大小是0是无法导入到 tfs 当中,所以要把这些文件去掉,否则导入脚本会冲断。也可以在导入脚本中捕捉这些异常而忽略掉,但这里使用手动找出,方便纪录。</p><p>带有&nbsp;<code>null</code>&nbsp;字符的路径去掉:</p><pre>grep -v null TBL_TXN_VOUCHER_INF-1504-05-1.txt &gt; TBL_TXN_VOUCHER_INF-1504-05-1.tmp.txt
mv TBL_TXN_VOUCHER_INF-1504-05-1.tmp.txt TBL_TXN_VOUCHER_INF-1504-05-1.txt</pre><p>构造完整图片路径:</p><pre>cut -d "," -f2 TBL_TXN_VOUCHER_INF-1504-05-1.txt &gt; a.txt
vim a.txt</pre><p>行首增加绝对路径前缀&nbsp;<code>/opt/mfs/images/cashbox</code></p><pre>:%s/^/\/opt\/mfs\/images\/cashbox/g</pre><p>排序找出文件大小为0的文件:</p><pre>dos2unix a.txt
cat a.txt |xargs -i du -sh {} &gt; b.txt
sort -n b.txt &gt; c.txt</pre><p>编辑打开 c.txt 文件将文件大小为0的保留其他删除掉。</p><p>比较去掉文件大小为0的纪录</p><pre>vimdiff TBL_TXN_VOUCHER_INF-1504-05-1.txt c.txt</pre><h2>导入签名</h2><p>防止 vpn中断将导入程序放后台运行</p><pre>nohup ruby import_images_to_tfs.rb TBL_TXN_VOUCHER_INF-1504-05-1.txt &gt; TBL_TXN_VOUCHER_INF-1504-05-1.update.txt
ruby gen_dc_sql.rb TBL_TXN_VOUCHER_INF-1504-05-1-update.txt &gt; TBL_DC_TXN_VOUCHER_INF-1504-05-1-update.sql</pre><p>检查是否有 feff 问题:</p><pre>grep -I -r </div>
</div>
<!-- 该js供其它处理 -->
<script src="../leanote-html.js"></script>
</body>
</html>\xEF\xBB\xBF' TBL_TXN_VOUCHER_INF-150601-09-update.sql</pre><p>如果有,手动删掉<code>&lt;feff&gt;</code>字符,否则无法写入数据库。</p></div></div></div>
</div>
<!-- 该js供其它处理 -->
<script src="../leanote-html.js"></script>
</body>
</html>