WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Backup script for Onboot.lst's  (Read 1964 times)

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Backup script for Onboot.lst's
« on: December 14, 2013, 10:03:24 PM »
I don't know if anyone else will find a need for a backup script specific to Onboot.lst's, but considering I found the script indispensable in saving various custom Onboot.lst configurations I figured someone may one day find this script answer their needs.

I named it Onboot_sos   SOS for Save On Shutdown, among other things. 

Ok this script supports standard or multiple custom Onboot.lst's and performs these functions in this order

1. On first run creates a backup of the original Onboot.lst to a hidden file then sets permissions to prevent inadvertent deletion
2. creates a backup of the current Onboot.lst
3. maintains only the the most recent 9 backups, rotating old backups beyond 9 out to the trash on each subsequent backup creation.
4. Sorts the contents of current Onboot.lst(s) alphabetically

This backup script has functioned successfully to the point where I made an extension with a startup script which adds the backup command to shutdown.sh, effectively creating a new backup efficiently on each shutdown.

If anyone would like to try the extension please pm me, meanwhile the script is attached.

I wondered whether 9 backups was a little to much, but it has saved the day more than once being able to restore a previous onboot configuration after messing up an onboot lst.  You don't expect this to happen, but stuff happens when you least expect it.

Note: some level of tce persistence is obviously required (at minimum a tce directory installed to a drive).

As always, feedback, suggestions is welcome.   
« Last Edit: December 14, 2013, 10:19:21 PM by coreplayer2 »

Offline Pats

  • Sr. Member
  • ****
  • Posts: 322
Re: Backup script for Onboot.lst's
« Reply #1 on: December 14, 2013, 11:28:00 PM »
Sorry tobe ignorant, but what can be possible uses of this script for a common user like me? Or is this for developers / testers / Package creators etc ?
May be a dumb question ...

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: Backup script for Onboot.lst's
« Reply #2 on: December 27, 2013, 06:39:16 PM »
Lets just say we used only one onboot lst and lost it due to an error or corruption or whatever,  most likely we could  recreate it from memory. how about two?  even several customized onboot lists?  My memory is not that good, so I created this script to take care of that problem, given that I have have as many 8 onboot lists per machine with corresponding boot config entries, i think it's worth backing up.   I backup everything onsite and offsite, call me paranoid.

So am sharing the script which can be tuned to keep as few or as many of the last created onboot lst's as you choose. 

« Last Edit: December 27, 2013, 06:42:59 PM by coreplayer2 »