Hitachi Vantara Pentaho Community Forums
Results 1 to 9 of 9

Thread: Schell Robocopy

  1. #1

    Default Schell Robocopy

    Hi guys,

    I am executing a schell job, executing a .bat file that executes robocopy and moves files from one dir to another.

    All works well, but the issue here is that spoon is not recognizing if the result of the process is true or false.

    The logs show that the step gives a true value, but in the interface, it does not matter if it has executed correctly or not it always sends the result to FALSE.

    Any advice.

    Regards,

    Ben

  2. #2
    Join Date
    May 2006
    Posts
    4,882

    Default

    Maybe attach the transformation, and the part of your batch script where you exit.

    Regards,
    Sven

  3. #3

    Default Shell Robocopy Reply

    Hi sven,

    I am attaching 2 jobs, the first one is part of a big process and the other one isolates only the robocopy shell job.

    Any advice, will be appreciated.

    Regards,

    Ben
    Attached Files Attached Files

  4. #4
    Join Date
    Jul 2007
    Posts
    247

    Default

    please also attach D:\Verificaciones\Bat\MoverArchivos.bat as this is could be the reason why you don't get any true result...

  5. #5

    Default Thread: Schell Robocopy Reply to Thread

    The content of the Bat file is:

    @Echo off
    robocopy.exe "D:\Verificaciones\Archivos" "D:\Verificaciones\Backup" IB*.txt /NP /IS /MOV

    I have tried to upload it but The forum doesn't accept those type of files, even if they are .zipped.

    Thanks a lot.

    Regards,

    Ben

  6. #6
    Join Date
    May 2006
    Posts
    4,882

    Default

    Make the return code explicit... 0 is good, anything else is bad... Maybe robocopy has other return codes (which would need to be mapped then).

    Regards,
    Sven

  7. #7

    Default Thread: Schell Robocopy Reply to Thread

    Thanks a lot.

    Ben

    Quote Originally Posted by sboden View Post
    Make the return code explicit... 0 is good, anything else is bad... Maybe robocopy has other return codes (which would need to be mapped then).

    Regards,
    Sven

  8. #8

    Default Thread: Schell Robocopy Reply to Thread

    Sven,

    Because I didn't need to transfer files from one server to another, and only needed to do the move file operation locally in the same machine, I decided to use the move command. Its results are ok, TRUE and FALSE work greate.

    One question, the move file object that your team is finishing will permit to move files from server to server? or only local, or it wont make any difference where?

    Thanks a lot for your advice.

    Regards,

    Ben

  9. #9
    Join Date
    Jul 2007
    Posts
    247

    Default

    One additional comment on the exit status:

    Assuming that you are using Windows you can get the return code from the environment variable errrorlevel:

    Code:
    if not %errorlevel%==0 (
       echo Something went wrong...
       exit 1
    ) 
    else (
       echo Everything is ok!
       exit 0
    )
    Maybe errorlevel != 0 doesn't mean it's an error, it could also be a warning for example. I don't know the meaning of robocopy's return codes...

    Regards,
    Ben
    Last edited by BeLienig; 07-31-2007 at 01:39 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.