I think a better way than adding copy command to init script would be to use <a href="http://inotify.aiken.cz/?section=incron&page=about&lang=en">incron</a> utility. This utility triggers cron jobs based on file system triggers so you can backup a file when it is changed. You can do SVN/Git commit or even do an rsync so whenever you change the file it is automatically backed up.<br>
<br>Regards,<br>Qasim<br><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Nov 6, 2012 at 10:12 PM, Ovidiu Sas <span dir="ltr"><<a href="mailto:osas@voipembedded.com" target="_blank">osas@voipembedded.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Just use git to track down your changes.<br>
<div class="HOEnZb"><div class="h5"><br>
On Tue, Nov 6, 2012 at 11:25 AM, Muhammad Shahzad<br>
<<a href="mailto:shaheryarkh@googlemail.com">shaheryarkh@googlemail.com</a>> wrote:<br>
> No, file was not removed, but only changed with default opensips<br>
> configuration file that comes with its source code, so i guess any file<br>
> system utility won't help, specially when using EXT3 FS.<br>
><br>
> To avoid such situation in future i suggest to create backup configuration<br>
> file from start up script i.e. /etc/init.d/opensips, e.g. whenever we run<br>
> "/etc/init.d/opensips start", it should make a copy of opensips.cfg<br>
> somewhere safe like,<br>
><br>
> cp -arvf /usr/local/opensips/opensips.cfg<br>
> /var/run/opensips/opensips.cfg-<current-date-time><br>
><br>
> This backup is good not only for recovery but also to see what went to<br>
> production when..<br>
><br>
> But for current situation, it seems i am helpless.<br>
><br>
> Thank you.<br>
><br>
><br>
> On Tue, Nov 6, 2012 at 4:22 PM, alexandre Moutot <<a href="mailto:a.moutot@alphalink.fr">a.moutot@alphalink.fr</a>><br>
> wrote:<br>
>><br>
>> Hi,<br>
>><br>
>> Have you try to recover your file from your FS ?<br>
>><br>
>> Regards,<br>
>><br>
>> M. A.<br>
>><br>
>> ----- Original Message -----<br>
>> > From: "Muhammad Shahzad" <<a href="mailto:shaheryarkh@googlemail.com">shaheryarkh@googlemail.com</a>><br>
>> > To: "OpenSIPS users mailling list" <<a href="mailto:users@lists.opensips.org">users@lists.opensips.org</a>><br>
>> > Sent: Tuesday, November 6, 2012 3:57:33 PM<br>
>> > Subject: [OpenSIPS-Users] Recover running configuration of OpenSIPs<br>
>> > Hi,<br>
>> ><br>
>> ><br>
>> > Is there anyway to get currently loaded opensips.cfg in a running<br>
>> > instance of opensips? i have accidently lost the opensips<br>
>> > configuration of a running production server? The backup of<br>
>> > configuration file is bit old and does not contains most recent<br>
>> > changes so i am worried next time we restart opensips we may loose<br>
>> > some important changes in configuration file.<br>
>> ><br>
>> ><br>
>> ><br>
>> > I know its a bit stupid / awkward situation but any help will be<br>
>> > highly appreciated.<br>
>> ><br>
>> ><br>
>> > Thank you.<br>
>> ><br>
>> ><br>
>> ><br>
<br>
</div></div><div class="HOEnZb"><div class="h5">_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
</div></div></blockquote></div><br></div>