OS2 World.Com Forum

Subject  :  Xcopy behaving like the old DOS one with "/d"
Author  :  vingfel vingfel@excite.com
Date  :  28 Jun, 2005 on 21:45
I have a big fileserver running under eCS 1.1

I want, sometime, to backup the data hard drive on another hard drive.
The idea was to use a simple xcopy.
But if under DOS the "XCOPY x: y: /s /e /d" update the target file if the original fiole is younger, then the eCS need to have a date written after the "/d" switch.
I do not know hot to easely give a date after the "/d" on a script.

Is there another way to update the files on the target drive? Or switch which escaped of my view??

I like the XCOPY idea becasue if I delete a file in the X: drive, then the copy in the Y: drive is not deleted. I keepall, anfd update it.

Thank you for your help.


Subject  :  Re:Xcopy behaving like the old DOS one with "/d"
Author  :  davidfor
Date  :  29 Jun, 2005 on 02:17
I do similar things to this, but, I don't normally use XCOPY. Which I use is dependent on the situation:

- COPYDIR.CMD (part of DIRTOOLS package on hobbes) - Sounds like the match for what you are doing. It compares the source and target directories and files and only copies files that have been changed or added in the source.

- DSYNC.EXE (DSYNC014.ZIP on hobbes) - This is basically the same, but, it can also remove files from the target directory. So, if I delete a file from the source directory, it will be removed from the target directory as well. I use this to backup my PMMail directories to another machine each night.

As to the XCOPY parameters, I can think of two things:

- Wrap XCOPY with as small Rexx program that determines the date to use and then runs XCOPY with that. It could also store the run date somewhere to be used the next time. If you don't know Rexx well enough to do this, I or someone else can help. The disadvantage to this is if someone adds old files to the source disk (say by unzipping something), they won't be copied.

- I think you would be able to get away with using just about any date that is older than all files on the drive. So, I'd be tempted to do: "XCOPY x: y: /s /e /d:80-01-01" But, reading the XCOPY help, suggests that this will still copy all files. It doesn't say anything about only copying changed files.

---
David


Subject  :  Re:Xcopy behaving like the old DOS one with "/d"
Author  :  PeterSkye pskye_os2world@peterskye.com
Date  :  03 Jul, 2005 on 21:57

vingfel (28 Jun, 2005 21:45):
I want, sometime, to backup the data hard drive on another hard drive.
The idea was to use a simple xcopy.
. . .
Is there another way to update the files on the target drive?
. . .
I like the XCOPY idea becasue if I delete a file in the X: drive, then the copy in the Y: drive is not deleted. I keepall, anfd update it.

There is a problem with XCOPY -- my testing showed that it won't copy locked files, thus you may not get a usable backup.

Use dSync which is a synchronization program.

Here is an example of a file that XCOPY won't copy:

[M:\]xcopy G:\OS2\HELP\deter___.DB /h/o/t/s/e/r/v
Source files are being read...
SYS1186: XCOPY cannot access the source file.
G:\OS2\HELP\deter___.DB
0 file(s) copied.
[M:\]

dSync will copy the above file without problem.

On my main machine I have a dedicated drive with two backup partitions, and I alternate my backups so I always have two recent backups. Each drive which I back up goes into a directory, so for example my C: backup goes into M:\C\ today and N:\C\ tomorrow.

dSync will run much faster than XCOPY because it is a synchronizer. It only copies files which have changed (datetime stamp or filesize).

dSync *will* delete files from the backup which no longer exist on the source drive, so if you delete or rename a file the backup will not have"ghost" files on it. You said you wanted the ghost files so this may be a problem. Multiple backups might be a solution.

My reference for dSync is

http://zuko.mitm.ru/files/dsync016z.zip
http://zuko.mitm.ru/soft/dsync_en.html
http://zuko.mitm.ru/soft/dsync_history

although the site won't ping at the moment (nslookup finds it, perhaps the machine is off).

- Peter


Subject  :  Re:Xcopy behaving like the old DOS one with "/d"
Author  :  vingfel vingfel@excite.com
Date  :  21 Jul, 2005 on 15:17
I will use COPYDIR do to the task.

For information, here is the command line I will use:

copydir d:\ z:\ -errfile= c:\log\CopyBig250Errors.txt -log=c:\log\CopyBig250.txt -merge -logevent=copy_exclude -share -view_log=0

I want to thank you everybody who helped to find a solution.

Vingfel


Powered by UltraBoard 2000 <www.ub2k.com>