WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Filesystem compare your Running System against the tinycore.gz initrd file  (Read 4017 times)

Offline ixbrian

  • Retired Admins
  • Sr. Member
  • *****
  • Posts: 436
I am working on a script that will compare the filesystem on your running Tiny Core system against the tinycore.gz (or microcore.gz) initrd file.  It will show you the following:

-Files that only appear in the initrd and not the running system
-Files that only appear in the running filesystem and not the initrd
-Files that appear both places but have different contents
-Files that are identical in your running system and initrd and are included in your backup (you might want to consider excluding these files from backup) - As suggested by tinypoodle

In addition to just listing the files out, it will highlight in green the files that are in your mydata.tgz backup.  

I think this will be useful for the following reasons:

-You can easily run this to see what is possibly missing from your backup before you reboot.   For example, if you run the "adduser" command to add a user, you can run this script and it will show you that the /etc/passwd and /etc/shadow have different contents in the running system verses the initrd, and if they are not green in the list that means they are not included in your backup and these changes will be lost upon reboot.   If they are green, then you know they will be included in your backup.  

-If you upgrade to a new version of Tiny Core, you can run the script to easily see what files have changed between your backup and the new version of Tiny Core.  

-You can see if you have files being backed up that don't need to be included in your backup because they are identical to what is in the initrd.  

The script is attached to this post (you must be logged in to the forum to download).   It will run in Tiny Core Base with no additional extensions required.  The script is a proof of concept and could use some work.  If you find this useful let me know and I will continue to work on it.  

Thanks,
Brian
« Last Edit: August 08, 2010, 02:32:31 PM by ixbrian »

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
What about an option of distinguishing files which are identical in the initrd and the running system with a separate colour? This could assist in eliminating redundant files from backup. e.g. when "home" is an entry in .filetool.lst (default), one could then add all the identical files to .xfiletool.lst .

(Haven't had a chance to test the script as I am currently running booted via netboot)
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline ixbrian

  • Retired Admins
  • Sr. Member
  • *****
  • Posts: 436
What about an option of distinguishing files which are identical in the initrd and the running system with a separate colour? This could assist in eliminating redundant files from backup. e.g. when "home" is an entry in .filetool.lst (default), one could then add all the identical files to .xfiletool.lst .

(Haven't had a chance to test the script as I am currently running booted via netboot)

That's a great idea.   I added a new section that shows files that are identical between your running system and the initrd and which are also included in your backup.  This will make it easy to see if you have files in your backup that are probably not needed in the backup as you suggested.

I also fixed a bug that came up if you had directories with spaces in the name.  

The updated version is attached to the first post in this thread.  

Thanks again for the suggestion.

Brian

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
How are files contained in backup defined?
Based on state of .filetool.lst/.xfiletool.lst at time of running script?
Or based on last saved mydata.tgz?
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline ixbrian

  • Retired Admins
  • Sr. Member
  • *****
  • Posts: 436
How are files contained in backup defined?
Based on state of .filetool.lst/.xfiletool.lst at time of running script?
Or based on last saved mydata.tgz?

The script gets a list of files contained in your current mydata.tgz, it does not read .filetool.lst or .xfiletool.lst at all.

Brian