atitit.提升備份檔案複製速度(3)----建立同步刪除指令碼

來源:互聯網
上載者:User

atitit.提升備份檔案複製速度(3)----建立同步刪除指令碼

atitit.提升備份檔案複製速度(3) ----建立同步刪除指令碼

1. 建立同步刪除指令碼兩個方法.. 1

2. 1從資源回收筒info2檔案... 1

3. 清理結束在後snap比較 1

4. Npp replace gene del from lst 1

5. Code 2

1. 建立同步刪除指令碼兩個方法..2. 1從資源回收筒info2檔案...

Copy info2

{String s="G:\\RECYCLER\\S-1-5-21-602162358-1284227242-682003330-500\\info2";

core.copy(s, "c:\\info2.txt");

geneDelBatShell >>gene del.bat

3. 清理結束在後snap比較

trave2sqlUtil>>snap.sql

比較 SELECT CONCAT('del',' ','"',file,'"') as t FROM `foldercount` where file not in (select file from foldercountclraftr )

匯出lst.txt.bat

作者:: 老哇的爪子 Attilax 艾龍, EMAIL:1466519819@qq.com

轉載請註明來源: http://blog.csdn.net/attilax

4. Npp replace gene del from lst

\r\n >>>"\r\n del " 

5. Db ddl

CREATE TABLE `foldercount` (

`file` varchar(255) DEFAULT NULL,

`size` int(11) DEFAULT NULL,

`id` int(11) NOT NULL AUTO_INCREMENT,

`extname` varchar(255) DEFAULT NULL,

PRIMARY KEY (`id`),

KEY `i_f` (`file`)

) ENGINE=InnoDB AUTO_INCREMENT=39702 DEFAULT CHARSET=utf8;

CREATE TABLE `foldercountclraftr` (

`file` varchar(255) DEFAULT NULL,

`size` int(11) DEFAULT NULL,

`id` int(11) NOT NULL AUTO_INCREMENT,

`extname` varchar(255) DEFAULT NULL,

PRIMARY KEY (`id`),

KEY `i_f2` (`file`)

) ENGINE=InnoDB AUTO_INCREMENT=51753 DEFAULT CHARSET=utf8;

6. Code

geneDelBatShell

public class geneDelBatShell {

/**

@author attilax 老哇的爪子

\t@since Aug 3, 2014 4:00:19 AM$

* @param args

* @throws IOException

*/@SuppressWarnings("all")

public static void main(String[] args) throws IOException {

// attilax 老哇的爪子 4:00:19 AM Aug 3, 2014

final filex fc = new filex("c:\\infoDelBat.bat");

String s = "c:\\info2.txt";

filex.read_HP(s, "gbk", new Closure() {

@Override

public Object execute(Object arg0) throws Exception {

// attilax 老哇的爪子 4:11:57 AM Aug 3, 2014

{

String line = arg0.toString();

List<String> li = strUtil

.find(regExpress.pathExpress, line);

for (String f : li) {

if(f.length()<9)continue;

String fname=filex.getExtName(f);

if(fname.length()==0)continue;

System.out.println(f);

if(pathx.isFile(f))

fc.append_HP(f + "\r\n");

}

return null;

}

 

}

});

fc.close();

System.out.println("--f");

}

// attilax 老哇的爪

trave2sqlUtil

private static void trav() throws IOException {

final String fileName = "c:\\clraft.sql";

final CharSequence tab="folderCountClraftr";

final filex fc = new filex(fileName);

dirx.trave("G:\\ati\\doc", new Closure() {

@Override

public Object execute(Object arg0) throws Exception {

// attilax 老哇的爪子 3:46:39 AM Aug 2, 2014

{

String fname = arg0.toString();

String oriname=fname;

fname=fname.replace("'", "\\'");

File f = new File(fname); 

String sql = "insert @t(file,size,extname)values('@f',@size,'@ext') "

.replace("@f", fname)

.replace("@size", String.valueOf(f.length()))

.replace("@ext", filex.getExtName(oriname))

.replace("@t",tab);

logger.info(sql);

sql = sql.replace("\\", "\\\\");

sql = sql.replace("\\\\'", "\\'");// Coldwine\\'s Blog - 部落格園.htm restore to \'

fc.append_HP(sql + ";\r\n");

return null;

}

}

});

fc.close();

}

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.