This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
opencpn.conf gets randomly emptied WALKED AROUND
#1
Rather than duplicate the info, I have posted a new thread on cruisers forum regarding an issue with opencpn.conf file getting corrupted.
So far, the issue doesn't seem to be addressed by the OpenCPN team ...

The walk around  I mention makes use of 2 bash scrips, one to create a backup of opencpn.conf, to be run when everything is going nicely, and the second one to restore the opencpn.conf when the catastrophe happened !
Not so elegant, but please consider these are my very first bash scripts !
here they are :

Backup :
# this script backs up the opencpn.conf file in the
# directory : ~/Sauvegardes
#OpenCPNshould be stooped 1st (CTRL+Q) and
# the content of opencpn.conf checked non empty)
cp /home/pi/.opencpn/opencpn.conf /home/pi/Sauvegardes/opencpn.conf

Restore :
# this script replaces the file /.opencpn/opencpn.conf,
# when corrpted with he file formerly saved in the directory : ~/Sauvegardes
# Save the corrupted file, target of the pocedure, for forensic analysis :
cp /home/pi/.opencpn/opencpn.conf /home/pi/.opencpn/garbage.ocpn.txt
# delete the corrupted file :
rm -f /home/pi/.opencpn/opencpn.conf
# replace the corrupted file by its backup :
cp /home/pi/Sauvegardes/opencpn.conf /home/pi/.opencpn/opencpn.conf

Edit : see improved script later in this thread

Being a complete newbie in the art of bash/Linux, I am sure these scripts can be condensed, and then improved, maybe merged in a single script which would run automaticaly at startup ?

I am opened to any suggestion to automate the process as much as possible !
Cordialement
Didier B
Pi4, SSD USB3, OP 3.0 Touch SK 3.2.1 OpenCPN  5.8.4 :  Thank you  Thank you  Thank you


Reply


Messages In This Thread
opencpn.conf gets randomly emptied WALKED AROUND - by Didier B - 2019-05-29, 07:53 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)