Login | Register
My pages Projects Community openCollabNet

Discussions > users > exitcode of fsvs diff

fsvs
Discussion topic

Hide all messages in topic

All messages in topic

Re: exitcode of fsvs diff

Author pmarek
Full name P.Marek
Date 2008-10-01 09:10:39 PDT
Message Hello Gunnar!

On Tuesday 30 September 2008 Gunnar Thielebein wrote:
> For test I did some changes; then execute these two commands with
> different result.
>
> > gthielebein@ws-adm03:/$ if sudo fsvs status -ostop_change=true;then
> > echo true;else echo false;fi
> > false
> > gthielebein@ws-adm03:/$ if sudo fsvs status ;then echo true;else echo
> > false;fi
> > .m.? 244 etc/hosts
> > .m.. dir etc
> > true
>
> Do i miss something here?
Maybe; I think it works as expected.

The documentation says

  The return code is 0 for successfull and 2 for an error. 1 is returned if
  the option "Stopping status reports as soon as changes are found" is used,
  and changes are found; ...

A normal "status" should never return an error - unless there's been one :-)
If you use the option, you'll get an exit code *if* changes are found.


Better now? Or how can I improve the documentation, so that it's clearer?


Regards,

Phil

--
Versioning your /etc, /home or even your whole installation?
             Try fsvs (fsvs.tigris.org)!

Re: Re: exitcode of fsvs diff

Author tekknokrat
Full name Gunnar Thielebein
Date 2008-09-30 13:38:58 PDT
Message Hi Phil,

I am late again on the cron-script.
when using the -ostop_change option it does not give me output I need.
Sorry that i test this option such late but cron script was not really
needed before.
Now we have email-setup for some hosts in satellite-system and can use
this in production.

For test I did some changes; then execute these two commands with
different result.
> gthielebein@ws-adm03:/$ if sudo fsvs status -ostop_change=true;then
> echo true;else echo false;fi
> false
> gthielebein@ws-adm03:/$ if sudo fsvs status ;then echo true;else echo
> false;fi
> .m.? 244 etc/hosts
> .m.. dir etc
> true
Do i miss something here?

Regards,
Gunnar

Re: Re: exitcode of fsvs diff

Author pmarek
Full name P.Marek
Date 2008-06-16 03:42:22 PDT
Message ...
>> if fsvs -o stop_change=yes status /;then echo "nothing changed";fi
>>
>> I was irritately first trying with "fsvs diff" but you used "status" for
>> avoid connections to the repo, didn't you?
Yes.

> *waah*, just learned about the "svn status" command
You're not a long-time user of subversion, are you :-)


Good luck ... ;-)


--
Versioning your /etc, /home or even your whole installation?
             Try fsvs (fsvs.tigris.org)!

Re: Re: exitcode of fsvs diff

Author tekknokrat
Full name Gunnar Thielebein
Date 2008-06-16 03:39:40 PDT
Message > Gunnar Thielebein schrieb:
>> Philipp Marek schrieb:
>>> On Tuesday 10 June 2008 Philipp Marek wrote:
>>>
>>>> On Tuesday 10 June 2008 Gunnar Thielebein wrote:
>>>>
>>>>> Do you mind of some other way checking for changes?
>>>>>
>>>> I'm currently implementing an option "stop_change" for use in scripts.
>>>>
>>>> Please stand by :-)
>>>>
>>> r1736, http://fsvs.tigris.o​rg/source/browse/fsv​s/trunk/fsvs/?rev=17​36
>>> HTH; I hope for a release soon.
>>>
>>>
>>> Regards,
>>>
>>> Phil
>>
>> Hi Phil,
>> Thank you very much for both of them r1736 and r1739!
>> I'll test them as soon as I have gained obverserver membership to you
>> svn.
>> For first use on our servers I have made a cron-script in this way now:
>>
>> #!/bin/sh
>> if [ -n "$(fsvs status /)" ];then
>> echo "Fsvs has found configuration changes in monitored directories.\
>> Attached is a diff-output of the relevant files.\n"
>> fsvs diff -R /
>> fi
>>
>> It is not much done here, only that the admin gets an email with a
>> review of the changes in case someone forgets to commit :-)
>>
>> Best Regards, Gunnar
>>
>> --------------------​--------------------​--------------------​---------
>> To unsubscribe, e-mail: users-unsubscribe@fs​vs.tigris.org
>> For additional commands, e-mail: users-help at fsvs dot tigris dot org
> works fine :-)
>
> if fsvs -o stop_change=yes status /;then echo "nothing changed";fi
>
> I was irritately first trying with "fsvs diff" but you used "status" for
> avoid connections to the repo, didn't you?
>

*waah*, just learned about the "svn status" command

Re: exitcode of fsvs diff

Author tekknokrat
Full name Gunnar Thielebein
Date 2008-06-16 03:32:47 PDT
Message Gunnar Thielebein schrieb:
> Philipp Marek schrieb:
>> On Tuesday 10 June 2008 Philipp Marek wrote:
>>
>>> On Tuesday 10 June 2008 Gunnar Thielebein wrote:
>>>
>>>> Do you mind of some other way checking for changes?
>>>>
>>> I'm currently implementing an option "stop_change" for use in scripts.
>>>
>>> Please stand by :-)
>>>
>> r1736, http://fsvs.tigris.o​rg/source/browse/fsv​s/trunk/fsvs/?rev=17​36
>> HTH; I hope for a release soon.
>>
>>
>> Regards,
>>
>> Phil
>
> Hi Phil,
> Thank you very much for both of them r1736 and r1739!
> I'll test them as soon as I have gained obverserver membership to you
> svn.
> For first use on our servers I have made a cron-script in this way now:
>
> #!/bin/sh
> if [ -n "$(fsvs status /)" ];then
> echo "Fsvs has found configuration changes in monitored directories.\
> Attached is a diff-output of the relevant files.\n"
> fsvs diff -R /
> fi
>
> It is not much done here, only that the admin gets an email with a
> review of the changes in case someone forgets to commit :-)
>
> Best Regards, Gunnar
>
> --------------------​--------------------​--------------------​---------
> To unsubscribe, e-mail: users-unsubscribe@fs​vs.tigris.org
> For additional commands, e-mail: users-help at fsvs dot tigris dot org
works fine :-)

if fsvs -o stop_change=yes status /;then echo "nothing changed";fi

I was irritately first trying with "fsvs diff" but you used "status" for
avoid connections to the repo, didn't you?

Re: exitcode of fsvs diff

Author tekknokrat
Full name Gunnar Thielebein
Date 2008-06-11 15:04:44 PDT
Message Philipp Marek schrieb:
> On Tuesday 10 June 2008 Philipp Marek wrote:
>
>> On Tuesday 10 June 2008 Gunnar Thielebein wrote:
>>
>>> Do you mind of some other way checking for changes?
>>>
>> I'm currently implementing an option "stop_change" for use in scripts.
>>
>> Please stand by :-)
>>
> r1736, http://fsvs.tigris.o​rg/source/browse/fsv​s/trunk/fsvs/?rev=17​36
> HTH; I hope for a release soon.
>
>
> Regards,
>
> Phil

Hi Phil,
Thank you very much for both of them r1736 and r1739!
I'll test them as soon as I have gained obverserver membership to you svn.
For first use on our servers I have made a cron-script in this way now:

#!/bin/sh
if [ -n "$(fsvs status /)" ];then
 echo "Fsvs has found configuration changes in monitored directories.\
 Attached is a diff-output of the relevant files.\n"
 fsvs diff -R /
fi

It is not much done here, only that the admin gets an email with a
review of the changes in case someone forgets to commit :-)

Best Regards, Gunnar

Re: exitcode of fsvs diff

Author pmarek
Full name P.Marek
Date 2008-06-10 11:22:16 PDT
Message On Tuesday 10 June 2008 Philipp Marek wrote:
> On Tuesday 10 June 2008 Gunnar Thielebein wrote:
> > Do you mind of some other way checking for changes?
>
> I'm currently implementing an option "stop_change" for use in scripts.
>
> Please stand by :-)
r1736, http://fsvs.tigris.o​rg/source/browse/fsv​s/trunk/fsvs/?rev=17​36
HTH; I hope for a release soon.


Regards,

Phil

--
Versioning your /etc, /home or even your whole installation?
             Try fsvs (fsvs.tigris.org)!

Re: exitcode of fsvs diff

Author pmarek
Full name P.Marek
Date 2008-06-10 09:53:15 PDT
Message Hello Gunnar!

On Tuesday 10 June 2008 Gunnar Thielebein wrote:
> I have an issue when trying to use fsvs in a simple shell script which
> should check the diff of an local directory and its head-revision and
> mail the output of diff to admin via a cron-job.
>
> In the man-pages and this thread
> (http://thread.gmane.​org/gmane.comp.sysut​ils.backup.fsvs.gene​ral/211/focus=
>217) I have seen that you for some reason doesnt forward the exitcode of
> diff but that I can use the -W flag to override that behaviour.
>
> When I use this command (and there are modifications in fileset):
>
> if sudo fsvs -Wdiff-status=stop diff /;then echo $?;fi
>
> I still get exitcode 0. Is there some error in usage?
No; you're doing nothing wrong.
But for changes "diff" returns a 1, and this is always ignored.
Only the 2 (for binary files) could get checked.

> Do you mind of some other way checking for changes?
I'm currently implementing an option "stop_change" for use in scripts.

Please stand by :-)


Regards,

Phil

--
Versioning your /etc, /home or even your whole installation?
             Try fsvs (fsvs.tigris.org)!

exitcode of fsvs diff

Author tekknokrat
Full name Gunnar Thielebein
Date 2008-06-10 08:39:06 PDT
Message Hi Philipp,

I have an issue when trying to use fsvs in a simple shell script which
should check the diff of an local directory and its head-revision and
mail the output of diff to admin via a cron-job.

In the man-pages and this thread
(http://thread.gmane.​org/gmane.comp.sysut​ils.backup.fsvs.gene​ral/211/focus=217)
I have seen that you for some reason doesnt forward the exitcode of diff
but that I can use the -W flag to override that behaviour.

When I use this command (and there are modifications in fileset):

if sudo fsvs -Wdiff-status=stop diff /;then echo $?;fi

I still get exitcode 0. Is there some error in usage?
Do you mind of some other way checking for changes?

Regards,
Gunnar
Messages per page: