[wpkg-users] Best practice for Copying a folder and the WPKG Check that its correct

Dave Evans dave.evans at goodness.co.uk
Wed Aug 20 19:09:16 CEST 2014


you could just rely on the exit code from Robocopy
http://ss64.com/nt/robocopy-exit.html

if the exit code is 2 or less, then everything is fine
up to 8 some odd things happened
above that something went wrong
(it's slightly more complicated than that)

so you could write

  <install cmd="Source_folder Destination_folder [files_to_copy] 
[options]" >
             <exit code="0" />
             <exit code="1" />
             <exit code="2" />
  </install >

and that will work
if it returns a code >= 3, then as Adam mentions, it will fail the 
script, and then it will try again the next time
if it returns a code <= 2, then the folders are synchronised

--------------------------------------------------------------
Dave

On 20/08/2014 10:05, Adam Thorn wrote:
> One option would be to have
>
> <install cmd='robocopy SOURCE DESTINATION' />
> <install cmd='robocopy foo.finished DESTINATION '/>
>
> and then check for the existence of (or the size of, or modification 
> time of) foo.finished in the destination folder. If the "main" 
> robocopy in the first <install> is interrupted, it'll resume from 
> where it left off the next time wpkg runs. Only after that robocopy 
> has finished will you then copy foo.finished, at which point you can 
> be confident that everything has copied.
>
> Adam
>
> On 20/08/2014 04:48, Patrick CAHILL wrote:
>> Hi All,
>> I want to make sure I am doing this in the best possible way.
>> I have a few packages that are just folder copying.
>> They have either just documents or shortcuts, nothing thats actually
>> installed or must be present for the entire package to be considered
>> complete.
>> I am unsure of the best WPKG Check to make sure the entire folder
>> structure has come down.
>> Things I am unsure of:
>> If RoboCopy doesnt copy the entire folder, I dont think that RoboCopy or
>> WPKG rolls back the failed copy and deletes those files/folders which
>> leads me to...
>> I cant use Check File exists since each file is independant of the
>> others and the presence of a particular one doesnt mean the entire
>> package is there (well I could but I would have to write a check for
>> each file in the folder bleh)
>> I cant use Check Folder exists because the folder contents might not be
>> completely copied.
>>
>> Several options I have seen that might work in a Check Execute:
>> Windows command "COMP", will compare two folders but will not recurse
>> subdirectories which will make the command file more complex.
>> RoboCopy /e /l /log:, will recurse but the log file will have to be 
>> parsed
>> Does anyone know of the best way to do this?
>> -- 
>> thanks
>> -Pat Cahill
>> M: Berserker Street SS
>> T: Glenmore SS
>> W: Berserker Street SS
>> T: Glenmore SS
>> F: Parkhurst SS
>>
>>
>> ------------------------------------------------------------------------- 
>>
>> SSLrack gives free SSL certificates for open source projects (and 
>> cheap for everyone else)!
>> http://www.sslrack.com/promo/free-ssl-certificates-open-source-projects
>>
>> ------------------------------------------------------------------------- 
>>
>> wpkg-users mailing list archives >> 
>> http://lists.wpkg.org/pipermail/wpkg-users/
>> _______________________________________________
>> wpkg-users mailing list
>> wpkg-users at lists.wpkg.org
>> http://lists.wpkg.org/mailman/listinfo/wpkg-users
>>
>
> -------------------------------------------------------------------------
> SSLrack gives free SSL certificates for open source projects (and 
> cheap for everyone else)!
> http://www.sslrack.com/promo/free-ssl-certificates-open-source-projects
>
> -------------------------------------------------------------------------
> wpkg-users mailing list archives >> 
> http://lists.wpkg.org/pipermail/wpkg-users/
> _______________________________________________
> wpkg-users mailing list
> wpkg-users at lists.wpkg.org
> http://lists.wpkg.org/mailman/listinfo/wpkg-users




More information about the wpkg-users mailing list