Bat incremental Backup/duplicate folders

May 18, 2009 at 10:06:40
Specs: Windows XP
Hi I've been trying to create a bat file that will copy a series of folders and files to another folder and duplicate the folders exactly as they were but without copying everything over and over again, and without any user input. I just want it to do it's job and go away. I want it to be able to compare the 2 folders and delete any files that have been moved from one folder to another in the original.

I don't know if this will help but this is my bat file so far.

set home=%~d0
%SystemDrive%
cd %USERPROFILE%\"My Documents"\
cd Test
echo n|xcopy *.* %home% /s
%home%


See More: Bat incremental Backup/duplicate folders

Report •


#1
May 18, 2009 at 10:26:42
I don't think you can do it with the built in batch functions. Try taking a look at mirror (http://www.snapfiles.com/reviews/Mirror/cmdmirror.html) it's a single EXE file, and if you copy it to your Windows directory, you can use the command "mirror dir1 dir2" in a batch file to mirror the contents of dir1 to dir2 as you described.

-Ryan Adams
Free Computer Tips and more:http://RyanTAdams.com

Paid Tech Support: Black Diamond


Report •

#2
May 18, 2009 at 10:51:08
Well I have a few ideas I just don't know enough about batch programming to do it.. one idea was to make a text file for each directory using the dir command like this:..

dir /s /b >>file list.txt

and then some how edit the text file with the pipe command adding the Xcopy command to all the lines and the destination and then use the text file to copy the files. After that I would use the other text file on the backup drive to compare the files on the 2 drives and delete the ones I don't want.. Although that program you have sent the link for will work.. I wonder if there is a way haha..


Report •

#3
May 18, 2009 at 19:35:44
That program didn't work. It appears to have some sort of folder name limitations.. I also found another program like it but it too has the same limitations.. so I got fed up and downloaded Allway Sync, it has some limitations on the free version but it does what I want.. it still would be nice if it could be done with a bat file though.

Report •

Related Solutions

#4
May 18, 2009 at 21:28:29
Not sure what limitations you have with the program I linked to. I have been able to use it to successfully mirror multiple folders/subfolders.

-Ryan Adams
Free Computer Tips and more:http://RyanTAdams.com

Paid Tech Support: Black Diamond


Report •


Ask Question