Sunday, June 13, 2010

robocopy -copy and move and forfiles - Delete files more than 15 day

The bat job #1

 

1.Copy file from d:\backup to g:\backup folder or Move file from d:\backup to g:\backup folder

robocopy e:\Backup f:\Backup /e (For Copy file)

 

robocopy e:\Backup\ f:\Backup\  /MOV (For Move file - delete from source after copying)

 

The bat job #2

 

2. Delete files more than 15 day

 

forfiles /p "f:\backup" /s /c "cmd /c if @isdir==FALSE echo del @file & del @file" /d -15

Print Friendly and PDF
Share/Bookmark

No comments:

Post a Comment