Batch file will not work

R

Richard Tetley

Subject: Batch file will not work


Any help with the following would be appreciated.

I have been using, entirely successfully, a batch file for backing up My
Documents folders, on several Win98 and XP machines. Set with several
switches including /D (copies files changed on or after the specified date.
If no date is given copies only those files whose source time is newer than
the destination time). The backup is to a folder on a FreeBSD server with
Samba installed, mapped as virtual network drive H:\.

Now on an existing XP machine, after changing the user, this switch does not
work i.e. the copy command insists on backing up everything, which is very
frustrating.

Any clues as to why this happens would be gratefully received.

A sample batch command follows:
cls
@echo This program will backup to your H:\Backups\folder, all the files
@echo in your C:\Documents & Settings\Richard\My Documents\ folder,
@echo that have newer dates than the date of the last backup, to H:\Backups
@echo The programme will run in the background.
cd\
xcopy C:\docume~1\richard\MyDocu~1\*.* /A /D /S /W /I /R /F /Y H:\Backups\

Regards
Richard Tetley
 
R

Rob Schneider

The destination (h:\Backups) should be before the parameters, not at the
end. See "xcopy /?" for clarification of this. I don't know if this
has any affect or not.

I think the problem is between Samba and XP on the times. I've seen
same when using the better copy program from Microsoft, robocopy. See
the Windows 2003 Server Resource Kit (free for download from Microsoft).
An excellent "robust" copy program.

Robocopy has the /FFT option which the manual says: Assume FAT File
Times (2-second granularity). Useful for copying to third-party systems
that declare a volume to be NTFS but only implement file times with a
2-second granularity.

This overcomes timestamp issues, within the 2-sec tolerance. I've not
tried or seen this in xcopy ... have used robocopy rather than xcopy
exclusively. I dobut xcopy has this level of sophistication. May wish
to fix the problem by abandoning xcopy and use robocopy.

rms

Hope this is useful to you. Let us know.

rms
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top