Daily Backup Solution

That still fails also :confused: grrrr the permission change

sudo ls -l /var/lib/grafana

what is the output of that?


kris@openhab2:/etc/openhab2$ sudo ls -l /var/lib/grafana
total 776
-rw-r--r--  1 grafana grafana 770048 Sep 14 21:42 grafana.db
drwxr-xr--  2 grafana grafana   4096 Aug 28 10:44 plugins
drwxr-xr--  2 grafana grafana  12288 Sep 27 10:10 png
drwxr--r-- 18 grafana grafana   4096 Sep  3 19:10 sessions
kris@openhab2:/etc/openhab2$

sudo ls -l /var/lib/grafana/png

kris@openhab2:/etc/openhab2$ sudo ls -l /var/lib/grafana/png
total 768
-rw-r--r-- 1 grafana grafana 4563 Sep 27 06:16 01jZD79pNf1Se08Stc9G.png
-rw-r--r-- 1 grafana grafana 5320 Sep 27 08:25 1TP7Yb93m8vtwHi3157i.png
-rw-r--r-- 1 grafana grafana 8738 Sep 27 09:46 25472aaiPE81xUabURyX.png
-rw-r--r-- 1 grafana grafana 3037 Sep 27 09:30 2FJl3352eO5ail2zwCT3.png
-rw-r--r-- 1 grafana grafana 5051 Sep 27 09:40 2MFv0rBPwC8FPnOdGnsd.png
-rw-r--r-- 1 grafana grafana 4956 Sep 27 06:03 2P2MPJTTGPEer4fP85Js.png
-rw-r--r-- 1 grafana grafana 7631 Sep 27 06:03 4ajti0VSlVyGWCesdZTz.png
-rw-r--r-- 1 grafana grafana 5419 Sep 27 08:42 4czllRB0Foz8Uet9u7D6.png
-rw-r--r-- 1 grafana grafana 9588 Sep 26 17:49 4HkjfjoS2dCI4S0oCE43.png
-rw-r--r-- 1 grafana grafana 5053 Sep 27 08:42 4nyS6GYGYAPnnip7r0QY.png
-rw-r--r-- 1 grafana grafana 8500 Sep 27 08:28 4oE6rETxwGnbnFb7bmjy.png
-rw-r--r-- 1 grafana grafana 2625 Sep 27 09:46 524A8Gvxuoeg4IcVQkOe.png
-rw-r--r-- 1 grafana grafana 3037 Sep 27 09:30 61uRs4do7ZktY5HDZMss.png
-rw-r--r-- 1 grafana grafana 4632 Sep 27 08:42 6AaI2WnIXVVZ60AGoZ98.png
-rw-r--r-- 1 grafana grafana 3031 Sep 27 08:42 6rB2dtlOgB8YMA3V44Cj.png
-rw-r--r-- 1 grafana grafana 4985 Sep 27 06:16 771BLf2hvs3T7hc3QH99.png
-rw-r--r-- 1 grafana grafana 7694 Sep 27 09:29 7j7Fts4RIFQKVhPed28D.png
-rw-r--r-- 1 grafana grafana 3031 Sep 27 08:42 7UCnY3hOFgEd99SuNKAD.png
-rw-r--r-- 1 grafana grafana 4633 Sep 27 08:42 87dsdfDg1IE34qDVz5hj.png
-rw-r--r-- 1 grafana grafana 5483 Sep 27 09:30 8xKlCT1Ewa4wiKQ7Z6Hs.png
-rw-r--r-- 1 grafana grafana 2633 Sep 27 06:03 a3se2x2LWJ0dXUgnnFPp.png
-rw-r--r-- 1 grafana grafana 8382 Sep 27 09:34 AcYLufl7A49JetTMdYoF.png
-rw-r--r-- 1 grafana grafana 8894 Sep 27 08:28 bjvy7EPh4QrPwSWN1QYI.png
-rw-r--r-- 1 grafana grafana 8432 Sep 27 09:46 C17jW4p8erebGRqbmu0w.png
-rw-r--r-- 1 grafana grafana 5000 Sep 27 09:30 CICHWNZc2InosNzoF6Hl.png
-rw-r--r-- 1 grafana grafana 7797 Sep 26 17:49 cTtA1gzXN9if61EE0WgY.png
-rw-r--r-- 1 grafana grafana 4688 Sep 27 09:30 cv1gCPS9XNzAn99JogS1.png
-rw-r--r-- 1 grafana grafana 9181 Sep 26 17:49 CXmu8CyGQ6vdr5Hw10Zm.png
-rw-r--r-- 1 grafana grafana 3036 Sep 27 09:40 dD1Hn46m24mUniYq27x4.png
-rw-r--r-- 1 grafana grafana 4618 Sep 27 08:25 dFgLTIaFbUh0X4BkgfpY.png
-rw-r--r-- 1 grafana grafana 3039 Sep 27 05:27 dLaMZuTfN3MLbCQxTy5E.png
-rw-r--r-- 1 grafana grafana 4686 Sep 27 09:30 DVOxqWl61d84PH4Fnvx9.png
-rw-r--r-- 1 grafana grafana 5471 Sep 27 09:40 ekeyy3SyLtDkLrqA6n6q.png
-rw-r--r-- 1 grafana grafana 5369 Sep 27 06:03 esxsKkqe8m5wDkONnxM6.png
-rw-r--r-- 1 grafana grafana 2621 Sep 27 08:32 fDI4KAhOBsPx87r7zEHJ.png
-rw-r--r-- 1 grafana grafana 7678 Sep 27 08:28 fi402cyCuqA6zEKA7XvG.png
-rw-r--r-- 1 grafana grafana 3052 Sep 27 06:16 FjrmCeR7pg2wCn6S8kob.png
-rw-r--r-- 1 grafana grafana 9181 Sep 26 17:49 g5pOKAmZCQ9643mimZXT.png
-rw-r--r-- 1 grafana grafana 8703 Sep 27 09:34 g6q6S1KEHZnuTB41sx0n.png
-rw-r--r-- 1 grafana grafana 5058 Sep 27 08:42 GORyYBJDICgpdibx2jb2.png
-rw-r--r-- 1 grafana grafana 2633 Sep 27 06:03 gYZrp4oc4wJjBdIQAJtx.png
-rw-r--r-- 1 grafana grafana 7631 Sep 27 06:03 hfQIr54DvnthTaA76GYy.png
-rw-r--r-- 1 grafana grafana 3037 Sep 27 09:30 hmTdzGZF4bXZpciJlag7.png
-rw-r--r-- 1 grafana grafana 4688 Sep 27 09:30 hTel7YSUuJdzfWg1mgSB.png
-rw-r--r-- 1 grafana grafana 5349 Sep 27 06:16 hv8wZKjx92iBDKiNwsAy.png
-rw-r--r-- 1 grafana grafana 4877 Sep 27 08:25 iHKC5HUqVb7CKGcJIc6A.png
-rw-r--r-- 1 grafana grafana 2632 Sep 26 17:49 Iuv7tGvihcbYR6kKvPYu.png
-rw-r--r-- 1 grafana grafana 7652 Sep 27 09:46 JPOtTs415npngBbsxydl.png
-rw-r--r-- 1 grafana grafana 7797 Sep 26 17:49 JVKwgzLJ6gNEq9nQPJHz.png
-rw-r--r-- 1 grafana grafana 2626 Sep 27 09:34 KEE4AqGq90dMpOVOXX8y.png
-rw-r--r-- 1 grafana grafana 8404 Sep 27 09:29 KoleUbVwuvHEveQx5egz.png
-rw-r--r-- 1 grafana grafana 8738 Sep 27 09:46 kqHZmB3M6dflg6Np8HGS.png
-rw-r--r-- 1 grafana grafana 2621 Sep 27 08:28 kWkpDZ03xItLqWgSeCCH.png
-rw-r--r-- 1 grafana grafana 5483 Sep 27 09:30 ljN8dssKdLT3c9BLDCWg.png
-rw-r--r-- 1 grafana grafana 9158 Sep 27 06:03 lU4Gw3TBnzFqY4EZuSuE.png
-rw-r--r-- 1 grafana grafana 4529 Sep 27 06:03 m5eIhFW25TE0yyomf73C.png
-rw-r--r-- 1 grafana grafana 9158 Sep 27 06:03 m5GBKuMAxeMlfIMuiey5.png
-rw-r--r-- 1 grafana grafana 9584 Sep 26 17:49 MFt7dpukbcgMigc4cLzC.png
-rw-r--r-- 1 grafana grafana 9181 Sep 26 17:49 MGKDif01hmslwGAu6IyC.png
-rw-r--r-- 1 grafana grafana 5483 Sep 27 09:30 MtiqizUPOHZo2zf0vx67.png
-rw-r--r-- 1 grafana grafana 9588 Sep 26 17:49 NPEK1C3169kbERjigxSF.png
-rw-r--r-- 1 grafana grafana 8895 Sep 27 08:32 nsVxKMYZGzMAgEuSrbzw.png
-rw-r--r-- 1 grafana grafana 5004 Sep 27 09:30 NYBo62SF4gihkTGdHK18.png
-rw-r--r-- 1 grafana grafana 8500 Sep 27 08:28 O97YkHLigvnS8yZwlPev.png
-rw-r--r-- 1 grafana grafana 8739 Sep 27 06:03 oC4rDIl6lE4p6DqWFur0.png
-rw-r--r-- 1 grafana grafana 2621 Sep 27 08:28 OT3FCRQOdhJOZPnReW5U.png
-rw-r--r-- 1 grafana grafana 2622 Sep 27 09:29 OWmXPUjCWYF5rIEaS3WA.png
-rw-r--r-- 1 grafana grafana 7652 Sep 27 09:46 pEMSrMLGahtBgCBk0LNz.png
-rw-r--r-- 1 grafana grafana 5058 Sep 27 08:42 Pfs86DOJfeY81SEY07IM.png
-rw-r--r-- 1 grafana grafana 4527 Sep 27 05:27 PHEltlrm6bTP6ngBzKYI.png
-rw-r--r-- 1 grafana grafana 5015 Sep 27 05:27 pSO4Ytja2nPClux3GObs.png
-rw-r--r-- 1 grafana grafana 3037 Sep 27 08:25 pwckHopcGw3JO6HEmkv3.png
-rw-r--r-- 1 grafana grafana 2625 Sep 27 09:46 PZwVRUOaBHKL1WK8gSfX.png
-rw-r--r-- 1 grafana grafana 4712 Sep 27 09:40 q1AVqsftWQ7oDl4nn3jW.png
-rw-r--r-- 1 grafana grafana 5110 Sep 27 05:27 q3jF1ztFK5acfWJB7rRR.png
-rw-r--r-- 1 grafana grafana 7678 Sep 27 08:28 QwzRcK4Z70qRhuZQnHFx.png
-rw-r--r-- 1 grafana grafana 8432 Sep 27 09:46 RH1yMCnH4aC1D2ySxj5R.png
-rw-r--r-- 1 grafana grafana 3031 Sep 27 08:42 S2CkGBsiIphpO7rKcEsk.png
-rw-r--r-- 1 grafana grafana 5117 Sep 27 05:27 sbVDr6945OoKNx5lqlAa.png
-rw-r--r-- 1 grafana grafana 8893 Sep 27 08:28 SxTk3CVjplQxlVRy2WcU.png
-rw-r--r-- 1 grafana grafana 5425 Sep 27 08:42 tde6kfKYWM67Q9XDyaAg.png
-rw-r--r-- 1 grafana grafana 2632 Sep 26 17:49 tg2iHscwBRZv4553FJDK.png
-rw-r--r-- 1 grafana grafana 8566 Sep 27 08:32 u31irL9ICf5WzrJXgH3p.png
-rw-r--r-- 1 grafana grafana 3030 Sep 27 06:03 UlGPt07OWcNI8muDvdss.png
-rw-r--r-- 1 grafana grafana 8739 Sep 27 06:03 v6BA02roQFj5hdMn2r1a.png
-rw-r--r-- 1 grafana grafana 2632 Sep 26 17:49 vcOj5m7QM3TjthlXI1md.png
-rw-r--r-- 1 grafana grafana 3038 Sep 27 05:27 vRQByz2pwoOljLfqCuVr.png
-rw-r--r-- 1 grafana grafana 5421 Sep 27 08:42 w9Ub1123KEXoXYBSX3Np.png
-rw-r--r-- 1 grafana grafana 4634 Sep 27 08:42 WimC3g4U9V1PV6xoofYu.png
-rw-r--r-- 1 grafana grafana 8807 Sep 27 09:29 x3cIBa2qk2LHs16IyBnr.png
-rw-r--r-- 1 grafana grafana 5004 Sep 27 09:30 xf2MGxEZ4SZy2oquQOak.png
-rw-r--r-- 1 grafana grafana 7797 Sep 26 17:49 XKTJ5ROcIdWqHvgUAJtr.png
-rw-r--r-- 1 grafana grafana 7662 Sep 27 08:32 xx7UcFbXVm67W0QUwV50.png
-rw-r--r-- 1 grafana grafana 4527 Sep 27 05:27 YBzhaRrGP0kx3aa6Qw4m.png
-rw-r--r-- 1 grafana grafana 7736 Sep 27 09:34 ZKuJqdA8lhEBQMKdpYs4.png
-rw-r--r-- 1 grafana grafana 5015 Sep 27 05:27 ZuyQXl3AkEBGBHuWm2Xk.png

sudo rclone -v --ignore-checksum --ignore-size --local-no-check-updated --config=/home/kris/.config/rclone/rclone.conf /var/lib/grafana Google:backup/openhab2/var/lib/grafana

what is the output of that

Error: unknown command “/var/lib/grafana” for “rclone”
Run ‘rclone --help’ for usage.
2018/09/27 17:02:54 Fatal error: unknown command “/var/lib/grafana” for “rclone”
kris@openhab2:/etc/openhab2/scripts$

sudo rclone -v --ignore-checksum --ignore-size --local-no-check-updated --config=/home/kris/.config/rclone/rclone.conf sync /var/lib/grafana Google:backup/openhab2/var/lib/grafana

made a typo

Its been running for 30minutes! but its backing up

you have have to go step by step in simplifying and integrating this script into the backup.sh
I would suggest at first you put an echo infront of you command:

echo rclone $rcloneOptions --config=$rcloneConfig sync $dir Google:backup/$localServer$dir

and look what the output is

It displays this:

kris@openhab2:/etc/openhab2/scripts$ echo rclone $rcloneOptions --config=$rcloneConfig sync $dir Google:backup/$localServer$dir
rclone --config= sync Google:backup/
kris@openhab2:/etc/openhab2/scripts$

strange, expecting to see something similar like:

sudo  /opt/backup/backup.sh

2018-09-27 10:36:05 : backup of /var/lib/grafana
rclone -v --ignore-checksum --ignore-size --local-no-check-updated --config=/home/lukics/.config/rclone/rclone.conf sync /var/lib/grafana raspiohab:/backup/raspiohab-utl/var/lib/grafana
2018-09-27 10:36:05 : backup of /etc/grafana
rclone -v --ignore-checksum --ignore-size --local-no-check-updated --config=/home/lukics/.config/rclone/rclone.conf sync /etc/grafana raspiohab:/backup/raspiohab-utl/etc/grafana

Ive got no idea :frowning: way out of my depth here!

If you need an alternative solution which works right out of the box:

https://www.linux-tips-and-tricks.de/en/quickstart-rbk

Integrating rclone into it would be an option, maybe?!

I use something really similar.

An old script from the last millenium. It just zips several folder to a mounted nfs share, includes incremental and and a full backup on sunday. All my Pis and similar back themselves up each night like that.

Quite simple. You just need to know what has to be done after a clean install. After the new base installation you just need to copy some files back from the archive. Which ones is personal knowledge.

For my openHAB machine the backup cron looks like this (as you suggested):

45 4   * * *   root    /usr/bin/openhab-cli backup
15 5   * * *   root    /opt/scripts/backup.sh "/etc /opt /boot /var/lib/openhab2/backups"

For the Kodi clients it looks like that:

20 5   * * *   root    /opt/scripts/backup.sh "/etc /opt /boot /home/osmc/.kodi"
  • Kodi restore is simple. Fill SD with latest OSMC image, sudo apt-get install mc, restore /opt, restore /home/osmc/.kodi, restore cron.d-files.
  • openHAB restore is a bit different because of openhab-cli, and additional installation of addons via paperui.

/boot is just for reference, in case some special hardware doesn’t work. So is /etc, just for software.

Just want to throw in a different concept that i think is superior. I have my openHAB Installation virtually, and a VMware Server on a 7 year old celeron. It’s a dedicated machine, that has a firewall instance, 3 openHAB instances (test, verification and productive use) and all of the instances get snapshots daily to a NAS that has off site replication (incl non related data like documents and Fotos). This way, if something breaks, I can immediately restore the system on any laptop or PC running VMware until I repaired that. And switching off and on to any version of any instance is just 2 clicks.

Are you aware of Amanda to be part of openHABian and that openHABian is not just a RPi image but a set of scripts that will run on most Linux ? I’m surprised you didn’t see that when browsing the forum.
There’s no need to reinvent the wheel (well unless you want to :slight_smile: ).
Amanda can backup/restore partitions so you can use it to create clone SD cards (or SSDs or whatever you’re running off) and when in need of restore, you don’t need to spend lots of work on re-installing the OS and all software beyond openHAB. Amanda can also backup selected directories/files, and it’ll take care of all the storage management, it can store to AWS S3 (available as an option in openHABian menu) and you can even use it to backup further 3rd party servers such as the InfluxDB/Grafana you mentioned or a Kodi.

I have setup initially Amada, even going the path to register AWS S3. The issue I have is that Amada does not backup toward Google and that is is so complex to use. It is a heavy weight tool.
Additionally I cannot access the backup-ed stuff easy as browsing the gdrive share an access versions.

I tried to setup Amanda yesterday with AWS S3, but it didn’t work. I haven’t found a good a complete tutorial an ran into a lot of different errors. Is there some.kind of tutorial anywhere?
Another “backup questions” where are the habpanel Widgets and configurations stored? Does openhab-cli backup includes habpanel?