Menu

RC2 after DIFF?

Help
Ilgrank
2016-05-23
2016-05-26
  • Ilgrank

    Ilgrank - 2016-05-23

    Hi
    Every now and then, but not always it seems (of course, it's just me not understanding when) when I do issue a
    snapraid DIFF, I got an exit code 2 instead of zero.
    I'm guessing RC2 stands for "Some file has changed".. am I right?
    is there an RC table?
    The closest match I found is here but nothing else..
    Thanks!

     
  • Steve Miles

    Steve Miles - 2016-05-23

    Exit codes are a bit of a mystery. Touch the timestamp in an array and it gives you Exit Code: 512 for a single modified file.

    Would love to have some API type docs showing all the exit codes and why.

    You can parse the log file

    user@server:~$ sudo snapraid -l diff.log diff
    user@server:~$ cat diff.log | grep summary
    

    Output:

    summary:equal:148027
    summary:added:0
    summary:removed:0
    summary:updated:0
    summary:moved:0
    summary:copied:0
    summary:restored:0
    summary:exit:equal
    
     

    Last edit: Steve Miles 2016-05-23
  • Ilgrank

    Ilgrank - 2016-05-23

    Thanks Steve.. you share my pain :)
    I had alrady log parsing in place, hence my doubt
    Everything is ok, but RC2 anyways..
    I check RC of DIFF in a script before doing a sync (among other things) and laterly (since SR 9.0 it seems) I've got those errors out of nowhere...

     
  • Ilgrank

    Ilgrank - 2016-05-25

    Ehm.. sorry but can we have an official RC list? :)
    Thanks

     
  • Steve Miles

    Steve Miles - 2016-05-26

    From latest help on github

    Diff
    If a "sync" is required, the process return code is 2, instead of the
    default 0. The return code 1 is instead for a generic error condition.
    

    Sure I got 512 after touch'ing a timestamp. Will check again tomorrow.

     

    Last edit: Steve Miles 2016-05-26
  • Ilgrank

    Ilgrank - 2016-05-26

    Thanks Steve! :)

     
  • Steve Miles

    Steve Miles - 2016-05-26

    Yep Exit Code for diff is 2 if sync needed!

    smileyman@hal-server:/media/2000GB1/Array/Media/Video/Series/24$ touch series.xml
    smileyman@hal-server:/media/2000GB1/Array/Media/Video/Series/24$ sudo snapraid diff
    Loading state from /etc/snapraid/snapraid.content...
    Comparing...
    update /media/2000GB1/Array/Media/Video/Series/24/series.xml
    
      148560 equal
           0 added
           0 removed
           1 updated
           0 moved
           0 copied
           0 restored
    There are differences!
    smileyman@hal-server:/media/2000GB1/Array/Media/Video/Series/24$ echo $?
    2
    smileyman@hal-server:/media/2000GB1/Array/Media/Video/Series/24$
    
     

Log in to post a comment.

MongoDB Logo MongoDB