[script] rsync your entire Raspberry OS to sd-card (swap and run incase of failure)

All kinds of 'OS' scripts

Moderator: leecollings

Post Reply
User avatar
Siewert308SW
Posts: 294
Joined: Monday 29 December 2014 15:47
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: The Netherlands
Contact:

[script] rsync your entire Raspberry OS to sd-card (swap and run incase of failure)

Post by Siewert308SW »

Was fiddling with a idea today.
As for many times i screwed my entire system again last week.
Although i had Domoticz backup is still needed to create a new rasbian image and install all packages again and set all conf also.
9 times out of 10 i forget what i had installed or amended to the system.
There for i came up the idea to take a second sd-card to which i weekly rsync my entire system via cron.
So that in case i scew up again i only need to swap cards and i'm back online in 30 seconds.
Only thing remaining is setting back my daily domoticz backup.

The first time this scripts is running it will do a full rsync.
The next time it only rsyncs files which are amended or new.
Saves me a lot of time and not afraid of screwing up things again ;-)

Wiki:
https://www.domoticz.com/wiki/Rsync_ras ... ash_script

Rsync script link:
https://bitbucket.org/Siewert308SW/domo ... ew-default
Last edited by Siewert308SW on Tuesday 27 December 2016 20:13, edited 2 times in total.
Setup:
- DS923+ Docker
Domoticz Latest Stable
Mosquitto / ZwaveJSUI @ Aeotec Z-Stick Gen5+ / PiHole Unbound
P1 USB Gas/Power, HW watermeter
- A lot of Zwave switches, contacts, plugs, smoke/Co2 ect
- DiY 7.5kWh Solar Storage @ GitHuB
nigels0
Posts: 221
Joined: Thursday 23 January 2014 12:43
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Contact:

Re: [script] rsync your entire Raspberry OS to sd-card (swap and run incase of failure)

Post by nigels0 »

An easier route is to use this script https://github.com/billw2/rpi-clone just needs one parameter.
User avatar
Siewert308SW
Posts: 294
Joined: Monday 29 December 2014 15:47
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: The Netherlands
Contact:

Re: [script] rsync your entire Raspberry OS to sd-card (swap and run incase of failure)

Post by Siewert308SW »

nigels0 wrote:An easier route is to use this script https://github.com/billw2/rpi-clone just needs one parameter.
Thx for spoiling my moment ;-)
Will post this script in the wiki and close this thread if thats possible...
Setup:
- DS923+ Docker
Domoticz Latest Stable
Mosquitto / ZwaveJSUI @ Aeotec Z-Stick Gen5+ / PiHole Unbound
P1 USB Gas/Power, HW watermeter
- A lot of Zwave switches, contacts, plugs, smoke/Co2 ect
- DiY 7.5kWh Solar Storage @ GitHuB
Nautilus
Posts: 722
Joined: Friday 02 October 2015 12:12
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Finland
Contact:

Re: [script] rsync your entire Raspberry OS to sd-card (swap and run incase of failure)

Post by Nautilus »

Siewert308SW wrote:
nigels0 wrote:An easier route is to use this script https://github.com/billw2/rpi-clone just needs one parameter.
Thx for spoiling my moment ;-)
Will post this script in the wiki and close this thread if thats possible...
After a quick look of the other suggested script it looks like it needs some user input during the operation (in it's standard format at least) and thus might not be optimal for scheduling. Also, you'd need to modify it at least for the part of handling Domoticz stop/start etc. So there's still a change to reclaim your moment I'd say...:) Of course, if you see the other script as somehow "better" then maybe use those parts to improve yours but anyhow I'd be interested to try this kind of full backup script optimised for RPi with the main purpose of running Domoticz! :D
User avatar
Siewert308SW
Posts: 294
Joined: Monday 29 December 2014 15:47
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: The Netherlands
Contact:

Re: [script] rsync your entire Raspberry OS to sd-card (swap and run incase of failure)

Post by Siewert308SW »

Nautilus wrote:
Siewert308SW wrote:
nigels0 wrote:An easier route is to use this script https://github.com/billw2/rpi-clone just needs one parameter.
Thx for spoiling my moment ;-)
Will post this script in the wiki and close this thread if thats possible...
After a quick look of the other suggested script it looks like it needs some user input during the operation (in it's standard format at least) and thus might not be optimal for scheduling. Also, you'd need to modify it at least for the part of handling Domoticz stop/start etc. So there's still a change to reclaim your moment I'd say...:) Of course, if you see the other script as somehow "better" then maybe use those parts to improve yours but anyhow I'd be interested to try this kind of full backup script optimised for RPi with the main purpose of running Domoticz! :D
thx... Noticed a flaw in the mounting section.
If the mount isn't right then it just syncs the data to a folder specified in the script called: MOUNT_LOCATION
So need to fix that
Setup:
- DS923+ Docker
Domoticz Latest Stable
Mosquitto / ZwaveJSUI @ Aeotec Z-Stick Gen5+ / PiHole Unbound
P1 USB Gas/Power, HW watermeter
- A lot of Zwave switches, contacts, plugs, smoke/Co2 ect
- DiY 7.5kWh Solar Storage @ GitHuB
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest