PxPlus User Forum
Main Board => Discussions => Programming => Topic started by: Jeffrey Ferreira on July 02, 2020, 11:45:43 AM
-
Hi List,
i'm trying to backup some data off hours. From what i read about XCOPY on Windows is that it should not lock the file. but i tend to get error 0's in pxplus if someone tries to access the file. There are very few users on system when i run this but i was just curious
does anyone know a command line way to backup files without causing error 0 in pxplus applications.
thanks
jeff
-
Jeff,
I don't know if this will help, but just because xcopy doesn't lock a file doesn't mean it can copy a locked file. So, this works:
0005 cmd$=env("COMSPEC")+" /C xcopy jmg.txt back"
0007 open (hfn)"jmg.txt"
0010 y=sys(cmd$)
0015 print y
But this doesn't:
0005 cmd$=env("COMSPEC")+" /C xcopy jmg.txt back"
0007 open lock (hfn)"jmg.txt"
0010 y=sys(cmd$)
0015 print y
Michael
-
For me this is what is failing
kickoff copy...while it is running...try to open file
0005 cmd$=env("COMSPEC")+" /C xcopy jmg.txt back"
0010 y=sys(cmd$)
0020 open (hfn)"jmg.txt"
line 20 gets an error 0
-
Have you tried robocopy? It has a wealth of switches that will likely do what you want. Check /z or /b or /zb. More info on available switches can be found here https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/robocopy
-
i did try robocopy but not those switches..
i'll give it a try..
thanks
-
Have you consider the PxPlus "CREATE FILE" command? It will allow you to copy opened files.
Have at look at: https://manual.pvxplus.com/?/directives/create_file.htm
-
No i haven't i will look at it...the robocopy flags looked promising but it did not work...i will look at create file....i'm just trying to do a cheap quick backup for client (not as their primary solution)...but a quick way we can go back a few days and view system as it was a few days ago.....i will try "create file" thanks