Atitit. Improve backup file copy speed (3)----Create a synchronous delete script

Source: Internet
Author: User
Tags closure file copy

Atitit. Improve backup file copy speed (3)----Create a synchronous delete script

1. Two ways to create a synchronous delete script: 1

2.1 Info2 file from Recycle Bin ... 1

3. Cleanup ends in post-snap comparison 1

4. NPP replace Gene del from LST 1

5. Code 2

1. Two ways to create a synchronous delete script :

2.1 Info2 file from Recycle Bin ...

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. cleanup ends in post-snap comparison

Trave2sqlutil>>snap.sql

Compare Select CONCAT (' del ', ' ', ' ' "', ' file ', '" ') as T from ' Foldercount ' where file is not in (SELECT file from Foldercountclraftr )

Export Lst.txt.bat

Author:: Old Wow's paw Attilax Ayron, email:1466519819@qq.com

Reprint please indicate source: 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 (one) DEFAULT NULL,

' id ' int (one) 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 (one) DEFAULT NULL,

' id ' int (one) 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 The claws of old Wow

\t@since 3, 4:00:19 am$

* @param args

* @throws IOException

*/@SuppressWarnings ("all")

public static void Main (string[] args) throws IOException {

Attilax's Paw 4:00:19 AM 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's Paw 4:11:57 AM 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 the claws of old Wow

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's Paw 3:46:39 AM 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-blog Park. htm restore to \ '

FC.APPEND_HP (sql + "; \ r \ n");

return null;

}

}

});

Fc.close ();

}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.