Atitit. Improve backup file replication speed (3) ---- create a synchronization Delete script

Source: Internet
Author: User

Atitit. Improve backup file replication speed (3) ---- create a synchronization Delete script

Atitit. Improve backup file replication speed (3) ---- create a synchronization Delete script

1. Two Methods for creating a synchronous Delete script... 1

2. 1. info2 file from the recycle bin... 1

3. After the cleanup is completed, snap compares 1.

4. Npp replace gene del from lst 1

5. Code 2

1. Create two methods to delete the script synchronously... 2. 1. The info2 file from the 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. After the cleanup is completed, the snap comparison

Trave2sqlUtil> snap. SQL

Compare select concat ('del ', '','" ', file,' "') as t FROM 'foldercount' where file not in (select file from foldercountclraftr)

Export lst.txt. bat

Author: old wow's paw Attilax iron, EMAIL: 1466519819@qq.com

Reprinted 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 (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 old wow's paw

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

* @ Param args

* @ Throws IOException

* // @ SuppressWarnings ("all ")

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

// Attilax old wow's paw 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 old wow's paw 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 old wow's claw

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 old wow's paw 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-Blog .htm restore \'

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.