OpenMarine
What files to back up? - Printable Version

+- OpenMarine (https://forum.openmarine.net)
+-- Forum: OpenPlotter (https://forum.openmarine.net/forumdisplay.php?fid=1)
+--- Forum: General discussion (https://forum.openmarine.net/forumdisplay.php?fid=2)
+--- Thread: What files to back up? (/showthread.php?tid=526)



What files to back up? - PaddyB - 2017-06-05

I'm in the process of setting up a node red flow to auto backup various files once a day - but which ones?
Will probably set up a dedicated openplotter dropbox to save them to. 


So far -  sudo cp -R /home/pi/.node-red/*.*
 /home/pi/.opencpn/ 

Think I'll add kplex as well and openplotter.conf.

So if I need to reinstall the sd card image from a backup, what other files would save too much setting up again if the backup image wasn't as up to date as it should be..? 

Ta


RE: What files to back up? - PaddyB - 2017-06-05

looks like a good enough starting point...

https://flows.nodered.org/flow/a275b56b419df8714641538fb2ad2f8a


RE: What files to back up? - Sailoog - 2017-06-06

node-red flows
openplotter.conf
opencpn.conf
/home/pi/.config/openplotter/imu/settings/RTIMULib.ini (IMU calibration)
kplex.conf


RE: What files to back up? - PaddyB - 2017-06-08

Thanks.  Here's a little node-red flow which backs up into /home/pi/files/backups 

The files/backups directories need to exist for it to work. 

Saves kplex.conf , all the files in .node-red, files and directories in .opencpn (so the logbook gets backed up, bit big this one so might need some trimming) &  openplotter.conf .

Hope this might be useful, any tips / ideas for improvement please share :Cool

Code:
[
   {
       "id": "ff37e71a.cfd4d8",
       "type": "exec",
       "z": "dcf0a43.0c79158",
       "command": "sudo tar ",
       "addpay": true,
       "append": "",
       "useSpawn": "",
       "timer": "",
       "name": "Execute TAR commands",
       "x": 690,
       "y": 380,
       "wires": [
           [
               "c11fcb83.2333e8"
           ],
           [
               "39689011.b3ef7"
           ],
           [
               "4daefb29.ce7564",
               "1c0fe9ea.bfd196"
           ]
       ]
   },
   {
       "id": "7ffc33ee.c11c4c",
       "type": "inject",
       "z": "dcf0a43.0c79158",
       "name": "Trigger Backups",
       "topic": "",
       "payload": "",
       "payloadType": "date",
       "repeat": "",
       "crontab": "",
       "once": false,
       "x": 260,
       "y": 220,
       "wires": [
           [
               "fac9399e.a052b8"
           ]
       ]
   },
   {
       "id": "c11fcb83.2333e8",
       "type": "debug",
       "z": "dcf0a43.0c79158",
       "name": "std out",
       "active": true,
       "console": "false",
       "complete": "payload",
       "x": 930,
       "y": 320,
       "wires": []
   },
   {
       "id": "39689011.b3ef7",
       "type": "debug",
       "z": "dcf0a43.0c79158",
       "name": "std error",
       "active": true,
       "console": "false",
       "complete": "payload",
       "x": 940,
       "y": 360,
       "wires": []
   },
   {
       "id": "4daefb29.ce7564",
       "type": "debug",
       "z": "dcf0a43.0c79158",
       "name": "return code",
       "active": true,
       "console": "false",
       "complete": "payload",
       "x": 950,
       "y": 400,
       "wires": []
   },
   {
       "id": "1c0fe9ea.bfd196",
       "type": "function",
       "z": "dcf0a43.0c79158",
       "name": "Detect Error",
       "func": "if (msg.payload==\"Error\") {\n  var returnMsg={topic: \"Error in nightly TAR backups\", payload:\"Error in nightly TAR backup operations\"};\n  return (returnMsg);\n  } else {\n      return (null);\n  }\n  \nreturn msg;",
       "outputs": 1,
       "noerr": 0,
       "x": 690,
       "y": 440,
       "wires": [
           [
               "b19def16.af5c1"
           ]
       ]
   },
   {
       "id": "fac9399e.a052b8",
       "type": "function",
       "z": "dcf0a43.0c79158",
       "name": "Generate TAR commands",
       "func": "var today = new Date();\nvar day = today.getDate();\nvar month = today.getMonth();\nvar year = today.getFullYear();\n\n\nvar filestamp= day +'-' + month + '-' + year;\n\n//Node-red backup Backup\nvar returnMsg1={payload: \"-zcvf /home/pi/files/backups/noderedbackup-\" + filestamp + \".tar.gz /home/pi/.node-red/*.*\"};\n\n//opencpn  Backup\nvar returnMsg2={payload: \"-zcvf /home/pi/files/backups/OcpnBackup-\" + filestamp + \".tar.gz /home/pi/.opencpn/\"};\n\n//Openplotter Config Backup\nvar returnMsg3={payload: \"-zcvf  /home/pi/files/backups/OpenP.confBackup-\" + filestamp + \".tar.gz /home/pi/.config/openplotter/openplotter.conf\"};\n\n//kplex Backup\nvar returnMsg4={payload: \"-zcvf /home/pi/files/backups/KplexBackup-\" + filestamp +\".tar.gz /home/pi/.kplex.conf\"};\n\n//Kick off the TAR commands!\nreturn [returnMsg1, returnMsg2,  returnMsg3, returnMsg4];\n\n\n",
       "outputs": "4",
       "noerr": 0,
       "x": 560,
       "y": 220,
       "wires": [
           [
               "ff37e71a.cfd4d8"
           ],
           [
               "ff37e71a.cfd4d8"
           ],
           [
               "ff37e71a.cfd4d8"
           ],
           [
               "ff37e71a.cfd4d8"
           ]
       ]
   },
   {
       "id": "b19def16.af5c1",
       "type": "debug",
       "z": "dcf0a43.0c79158",
       "name": "",
       "active": false,
       "console": "false",
       "complete": "false",
       "x": 950,
       "y": 440,
       "wires": []
   }
]



RE: What files to back up? - SkipperEarly - 2017-06-08

is a backup to the same SD card really useful? Maybe this flow should be extended to backup to e.g. dropbox or similar.


RE: What files to back up? - PaddyB - 2017-06-08

(2017-06-08, 02:40 PM)SkipperEarly Wrote: is a backup to the same SD card really useful? Maybe this flow should be extended to backup to e.g. dropbox or similar.

Probably will set up a dedicated small Dropbox at some point, or maybe get ftp working. Though I've never trashed a card so bad that you couldn't net at the files..... Yet anyway Wink

Sent from my SGP511 using Tapatalk


RE: What files to back up? - Sailoog - 2017-06-09

It was planned a tool to export different config files but it would need to wait for the stable version Smile