Forum Moderators: open

Message Too Old, No Replies

Tools to compare directories and files for backup purpose

Any of you using one of them? Freeware preferably...

         

tomda

2:09 pm on Oct 24, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi,

I am currently working on three different computers (two at home and one at work) and I use one external hard disk as backup.

I am looking for a tool (freeware preferably) that could compare directories/files so that my external hard disk only contains the latest updated files or new files.

I hope you understand me.

Thanks for sharing.

Tomda

Dabrowski

4:07 pm on Oct 24, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Use XCOPY!

Many people don't realise this, but you can easily use the xcopy command to do this...

Whenever Windows changes a file, i.e. you open a file and save it, or create a new file, it turns the archive attribute on. You can see this if you right click a file, click properties. See the attributes at the bottom, click Advanced and you'll see a "File is ready for archiving" box. This is the archive attribute.

Now, xcopy has a command line switch, /M, that only copies file with the archive attribute, and removes it once it has successfully copied the file.

See where I'm going with this?

tomda

4:22 pm on Oct 24, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Not really... But thanks anyway, I will do some search on the net about Xcopy.

i would ratther prefer an application where I can select directory in external disk and compare it with directory on hard drive.

anyway, thanks again... Will get back to you after testing that inetgrated windows archive system.

Tomda

Dabrowski

4:29 pm on Oct 24, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



ok, here's an example.
...say you keep your data in C:\DATA, and your removable drive is drive D...

The command:
XCOPY /M /E /Y C:\DATA D:\

Will copy the contents of the C:\DATA folder to the root of your removable drive.

/M tells it to only copy the archive files and reset the bit.
/E tells it to copy all subdirectories and files, even if empty.
/Y TURNS OFF! prompting to overwrite files.

So, first time you run it, it copies everything, but turns off archive flag.

Now, you change 5 files. Windows turns on archive flag.

You run same command again, now xcopy only looks for files with archive flag, so only the 5 changed files are copied.

Best thing to do is copy a few files into a folder and have a play. It's extremely simple and works very well for what is effectively, an incremental backup.

For more help, type XCOPY /? in a command window.

[edited by: Dabrowski at 4:30 pm (utc) on Oct. 24, 2008]

Swanny007

4:33 pm on Oct 24, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I use robocopy and use a script to backup from my laptop hd to my network hd. I'm pretty sure it's free. But yeah xcopy works fine too.

RonPK

5:53 pm on Oct 24, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Or try SyncToy, brought to you by the makers of Windows - for free! If you move a directory on the source PC, it will also move it on the target PC instead of first deleting it and than copying it again.

tomda

6:57 am on Oct 27, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Sweet ! I have more than I need.

Was looking for something similar to Picasa, where you can select directories to watch/scan...

Anyway, will try some of the apps. Xcopy seems nice but can I really use if I am planning to jungle between numerous computers.

Thank you. Very helpful !

lexipixel

8:30 am on Oct 27, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You could create a .BAT file and keep it on the portable disk... (going real old-school here).

Use a text editor and create a file called bu.bat... In that file enter the following:

XCOPY %1 %2 /M /E /Y

Now, from a DOS prompt you should be able to type:

bu c:\data d:\data

-OR-

bu *.html d:\htmlfiles

-OR-

bu c:\site1\images\*.jpg d:\jpgfiles

If you want to make it easy and you have a set procedure of backing up the same directories or files all the time, you could hard code them in BATCH FILE(S), e.g.-

(put as many different XCOPY commands as you want into a single "bu.bat" batch file)

XCOPY c:\data\images\*.jpg d:\data\jpgfiles /M /E /Y
XCOPY c:\site1 d:\site1 /M /E /Y
XCOPY c:\older\*.txt d:\older\text\ /M /E /Y

From a DOS prompt, type: xcopy /? and you'll get the full syntax and all the switches, (in-fact you can type /? after any DOS command and get the syntax, options and switches for that command).

tomda

9:03 am on Oct 27, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks lexipixel !

Flagged... Will try the bat file !

Dabrowski

1:17 pm on Oct 27, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Ooo, I remember %1 and %2 now!

ok, here's the next thing that will thwarte you, what if your removable drive is a different letter on different computers?

Put this code in your bu.bat (before the xcopy), it will search for itself, set a variable and then use that in your xcopy command.....

IF EXIST D:\BU.BAT SET MYHDD=D
IF EXIST E:\BU.BAT SET MYHDD=E
IF EXIST F:\BU.BAT SET MYHDD=F
IF EXIST G:\BU.BAT SET MYHDD=G
IF EXIST H:\BU.BAT SET MYHDD=H

...
you get the idea, go as far as you need to
...

I believe there's a more efficient way using FOR/IN but I never could get that to work properly.

So, we look for a file we know must exist, and set a variable (MYHDD) with the drive letter it's found on.

Now, change your xcopy command as follows:

XCOPY c:\data\images\*.jpg %MYHDD%:\data\jpgfiles /M /E /Y
XCOPY c:\site1 %MYHDD%:\site1 /M /E /Y
XCOPY c:\older\*.txt %MYHDD%:\older\text\ /M /E /Y

By using %MYHDD% we are telling the script, and yes it is now a simple script, to use that variable.

thecoalman

6:49 pm on Oct 27, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Check your FTP client. I haven't tried it just locally but I don't see any reason why such limitation would be imposed , I use Ipswitch as a FTP client and it has sync utility that I use to sync remote folders with local ones. e.g. if on remote host and not local host copy, if not on remote host but on local host delete, If newer on remote host than on local overwrite.... etc. It keeps the files perfectly in sync deleting what needs to be deleted and copying new or newer files

Even has scheduling option. It's not free though.