WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: [Solved] What is "/etc/sysconfig/backup" file purpose?  (Read 2414 times)

Offline jazzbiker

  • Hero Member
  • *****
  • Posts: 934
[Solved] What is "/etc/sysconfig/backup" file purpose?
« on: October 24, 2020, 02:41:33 PM »
Hi, brothers in Core!

This is not the question of a big importance, just the wish to understand, what's under the hood. Grep'in gave me nothing, probably not the proper places were grep'ed. Can anybody cure my anxiety?

Thanks in advance and

Have a nice Core!

P.S. In the http://forum.tinycorelinux.net/index.php/topic,22054.0.html thread Rich explains BACKUP variable purpose, but what software do utilize it and what is the difference between BACKUP variable and /etc/sysconfig/backup file?
« Last Edit: October 25, 2020, 11:45:26 AM by Rich »

Offline jazzbiker

  • Hero Member
  • *****
  • Posts: 934
Re: What is "/etc/sysconfig/backup" file purpose?
« Reply #1 on: October 24, 2020, 03:38:12 PM »
In the http://forum.tinycorelinux.net/index.php/topic,18970.0.html thread those BACKUP variable and /etc/sysconfig/backup file are discussed, gaining the theory, that these are (both, but they can differ?) the defaults for the X exit utility actions. But maybe something changed since 2015. I've changed in my ~/.profile
Code: [Select]
export BACKUP=0
#[ "`id -un`" = "`cat /etc/sysconfig/tcuser`" ] && echo "$BACKUP" | sudo tee /etc/sysconfig/backup >/dev/null 2>&1

but the default for X exit backup option is still "Safe". I am booting with "safebackup" bootcode.
So I still haven't found the impact.

Offline jazzbiker

  • Hero Member
  • *****
  • Posts: 934
Re: What is "/etc/sysconfig/backup" file purpose?
« Reply #2 on: October 25, 2020, 12:17:09 AM »
Now after some experiments I accurately suppose, that BACKUP variable is used by exittc utility as default for "Backup option" field. And "safebackup" bootcode overrides this variable value. What's the use of /etc/sysconfig/backup not clear yet.

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11694
Re: What is "/etc/sysconfig/backup" file purpose?
« Reply #3 on: October 25, 2020, 01:13:20 AM »
Hi jazzbiker
I did a little poking around in TC4 and TC10 and did not find anyplace  /etc/sysconfig/backup  gets read.

My guess is it's a remnant from an early version of TC. It probably got replaced by  export BACKUP=1  but was
never removed.

Offline jazzbiker

  • Hero Member
  • *****
  • Posts: 934
Re: What is "/etc/sysconfig/backup" file purpose?
« Reply #4 on: October 25, 2020, 01:43:28 AM »
Hi, Rich!

Thanks for Your answer and spending time on it. This file is written by .profile only for /etc/sysconfig/tcuser and  make sense only if You login as "tc", then logoff and relogin as somebody else and start X server. But... nobody home.

There are many useful tools under the TinyCore hood and it is just a fun trying to guess their meaning and purposes. Just like a little boy exploring father's room while father's gone working :-) Probably this file is some reminder about father's youth with unknown functions, so let's put it on its place and try to find something  amazing apart.

Thanks and best regards!

Seems, that topic can be marked as solved?

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11694
Re: [Solved] What is "/etc/sysconfig/backup" file purpose?
« Reply #5 on: October 25, 2020, 11:56:03 AM »
Hi jazzbiker
I did a little digging through the archives. TC3.1 is where  /etc/sysconfig/backup  first shows up in this form:
Code: [Select]
3.1
3.2
3.4
3.4.1
3.5
3.5.1
3.6
3.7
3.7.1
etc/skel/.profile:export BACKUP=1 && echo "$BACKUP" | sudo tee /etc/sysconfig/backup >/dev/null

Starting in TC3.8 it changed to this:
Code: [Select]
3.8
3.8.1
3.8.2
3.8.3
3.8.4
etc/skel/.profile:[ "`id -un`" = "`cat /etc/sysconfig/tcuser`" ] && echo "$BACKUP" | sudo tee /etc/sysconfig/backup >/dev/null
Nowhere could I find  /etc/sysconfig/backup  ever being read. I also looked through the sources of  exittc  and  filetool
and was unable to locate any references to  /etc/sysconfig/backup.

... Seems, that topic can be marked as solved?
Done. :)