Page 1 of 1

Creating automatic Backup and Shrink script

Posted: Friday 22 March 2024 15:10
by njlammerts
Afer my problems with Enever Energy Option and Token problems (wich resulted in faiiing Pi/Domoticz) https://www.domoticz.com/forum/viewtopic.php?t=42127 , i have been searching for methodes to backup running RPI/Domoticz i found several links and i used the following https://www.reddit.com/r/raspberry_pi/c ... ?rdt=65036 to create a running backup to a mounted NAS share https://raspberrypi-guide.github.io/fil ... rnal-drive .
Now i am able to make a IMG file/backup to remote location and shrink it to smaller format and this shrinked image can be restored to a SD card wich can boot a RPI again.

Now i want to make a automatic script, wich creartes an image once a week and after do a shrink and give the file a date-time stamp. It would be much appreciated to get some help as i dont have the right skills for this.

Re: Creating automatic Backup and Shrink script

Posted: Friday 22 March 2024 15:41
by njlammerts
I already used https://www.domoticz.com/wiki/Daily_bac ... ternal_hdd to make a daily backup of Domoticz DB to external location,
But due to compatibility problems between older versions of Domoticz and version Database I prefer a weekly IMG backup with a daily Domoticz Backup, so I can always go back to an older version Domoticz when needed, such as my crash with Enever Energy Token

Re: Creating automatic Backup and Shrink script

Posted: Friday 22 March 2024 15:47
by Kedi

Re: Creating automatic Backup and Shrink script

Posted: Monday 25 March 2024 12:44
by njlammerts
I Have seen the mentioned link mentioned by KEDI , and I used parts of it. But I do not like incremental backups, if somewhere an initial backup or incremental gets defective or the set is not together, you are screwed.
I used the part to create a mounted network share to create a IMG to. Then I used the shrink utility and this gets the "air" out of the IMG file.
I would like a script that runs automatically and gives the shrink tool a date/time stamp to the saved IMG, so I have a multiple IMG sets.
I would run this one a week or month and can always restore the matching database from the daily backup I have setup.

Re: Creating automatic Backup and Shrink script

Posted: Monday 25 March 2024 19:05
by HansieNL

Re: Creating automatic Backup and Shrink script

Posted: Monday 25 March 2024 23:22
by njlammerts
RaspiBackup is new for me, but I wil surely look in to that, thanks for pointing out......