Configuration Backup

Suggest new features here
Post Reply
WX4JCW
Posts: 16
Joined: Sun May 20, 2018 12:19 am
Location: United States

Configuration Backup

Post by WX4JCW »

Would it be possible to back up the CSS data on custom setups when you backup the system configuration? or did I miss something
Jason WX4JCW (MMDVM Commander Spot Running Pi-Star), XPR7550
KN2TOD
Posts: 268
Joined: Sun Nov 11, 2018 6:36 pm

Re: Configuration Backup

Post by KN2TOD »

The dashboard color codes can be saved by manually copying the /etc/pistar-css.ini file out during backups and reloading it during restores. Alternately, one can apply the following patch to the backup/restore process:

Code: Select all

rpi-rw
sudo sed -i 's/pistar-remote $backupDir 2>\&1");/pistar-remote $backupDir 2>\&1") ;\n\t  $output \.= shell_exec("sudo cp \/etc\/pistar-css.ini $backupDir 2>\&1");/1' /var/www/dashboard/admin/config_backup.php
sudo sed -i 's/backed up and restored<\/li>/backed up and restored <\/li>\n\t\t  <li>Dashboard color codes ARE also backed up and restored<\/li>/1'  /var/www/dashboard/admin/config_backup.php
rpi-ro
Astute users will note that this changes the backup process to include the applicable file but does not add anything to the restore process - the restore portion of the process is already set to handle the extra file. What this means is that a backup taken with a patched system can be restored on an unpatched system (such as a new image) without first applying the patch.
AF4FA
Posts: 47
Joined: Wed Jan 23, 2019 6:20 pm

Re: Configuration Backup

Post by AF4FA »

KN2TOD wrote: Sun May 24, 2020 1:36 pm The dashboard color codes can be saved by manually copying the /etc/pistar-css.ini file out during backups and reloading it during restores. Alternately, one can apply the following patch to the backup/restore process:

Code: Select all

rpi-rw
sudo sed -i 's/pistar-remote $backupDir 2>\&1");/pistar-remote $backupDir 2>\&1") ;\n\t  $output \.= shell_exec("sudo cp \/etc\/pistar-css.ini $backupDir 2>\&1");/1' /var/www/dashboard/admin/config_backup.php
sudo sed -i 's/backed up and restored<\/li>/backed up and restored <\/li>\n\t\t  <li>Dashboard color codes ARE also backed up and restored<\/li>/1'  /var/www/dashboard/admin/config_backup.php
rpi-ro
Astute users will note that this changes the backup process to include the applicable file but does not add anything to the restore process - the restore portion of the process is already set to handle the extra file. What this means is that a backup taken with a patched system can be restored on an unpatched system (such as a new image) without first applying the patch.
Will this patch have to be reapplied each time there is an update to the version unless it is added to the system by Andy?
KN2TOD
Posts: 268
Joined: Sun Nov 11, 2018 6:36 pm

Re: Configuration Backup

Post by KN2TOD »

Afraid so. But how often does one typically make config backups? Apply it if and only if you need it, just before taking a backup. Copy the commands to a .SH file so you can (re)run when needed. (Also, the commands can be rerun multiple times, on an already patched system, without ill effect.) You can tell when the patch has been removed - the extra verbiage will be gone at the bottom of the backup/restore dashboard.

Still, it would be nice if it were folding in to the base system.
KN2TOD
Posts: 268
Joined: Sun Nov 11, 2018 6:36 pm

Re: Configuration Backup

Post by KN2TOD »

I should add that I tested this modification for a single scenario: restoring a config to a new image, one that had CSS changes. Other scenarios (for instance, no CSS changes) need to be tested. And the modification was applied to fairly current systems (4.1.1 and 4.1.2) but not to any earlier versions, although the code change is simply enough it should still work.

Need more folks to try this out and give us some feedback.
User avatar
MW0MWZ
Site Admin
Posts: 1505
Joined: Wed Apr 04, 2018 9:15 pm
Location: Wales, UK
Contact:

Re: Configuration Backup

Post by MW0MWZ »

This was excluded from the backup on purpose, however the reasons for excluding it are rather less valid now, I will add it in soon.
Andy

73 de MW0MWZ
http://pistar.uk
EA3BIL
Posts: 103
Joined: Tue Apr 17, 2018 11:45 pm

Re: Configuration Backup

Post by EA3BIL »

MW0MWZ wrote: Wed Jun 03, 2020 10:01 am This was excluded from the backup on purpose, however the reasons for excluding it are rather less valid now, I will add it in soon.
Sorry to take this "Back to Live"...

Just a simple question:

Is CSS it now been backuped ??

Thanks for your comments !!

73'Rafa.
EA3BIL.
73'Rafael.
EA3BIL
JN11an
kt4lh
Posts: 1
Joined: Sun Jan 24, 2021 4:41 pm

Re: Configuration Backup

Post by kt4lh »

Same question here; backing up the CSS is trivial, just a line added to a file, but that's not really sustainable to edit the file frequently. Is there a reason the CSS Isn't backed up?
User avatar
MW0MWZ
Site Admin
Posts: 1505
Joined: Wed Apr 04, 2018 9:15 pm
Location: Wales, UK
Contact:

Re: Configuration Backup

Post by MW0MWZ »

there was a good reason, when it was all new :)

Now part of the backup.
Andy

73 de MW0MWZ
http://pistar.uk
Post Reply