WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: some cleanup questions  (Read 2771 times)

Offline emninger

  • Sr. Member
  • ****
  • Posts: 267
some cleanup questions
« on: December 22, 2015, 04:35:45 PM »
In the meantime i got a bit more familiar with tcl and therefore i wanted to clean-up my system a bit.

/home and /opt are set in the bootline.

My .filetool.lst looks like this:

Code: [Select]
etc/
usr/local/etc/
usr/local/etc/laptop-mode/laptop-mode.conf
usr/local/etc/laptop-mode/conf.d/usb-autosuspend.conf
usr/local/share/X11/xorg.conf.d/10-keyboard.conf
usr/local/etc/cups/ppd/HP_Deskjet_3900.ppd
usr/local/etc/cups/printers.conf
usr/local/etc/cups/cupsd.conf
etc/adobe/mms.cfg

My .xfiletool.lst looks like this:
Code: [Select]
Cache
cache
.cache
XUL.mfasl
XPC.mfasl
mnt
.adobe/Flash_Player/AssetCache
.macromedia/Flash_Player
.opera/opcache
.opera/cache4
.Xauthority
.wmx
etc/init.d
etc/modprobe.d
etc/pcmcia/
etc/profile.d
etc/skel/
etc/ssl/
etc/sysconfig/
etc/udev
etc/xdg/

Now, i know, i should not include directories, but, because i was so unfamiliar with tcl, many times i lost my settings and had to redo all the settings previously done ;)

For /etc you see i only protect the files in it (not any directory), but i'm unsure which ones really need to be protected and which ones not. Since i do not autologin i think passwd, passwd- and shadow and shadow- have to be protected. Moreover i protect hosts (since i do ad-blocking via hosts - i've a nice script to build from time to time a hosts file whereby i send to 0.0.0.0 crosscripting and advertising hosts) But what's with resolv.conf, fstab, wpa_supplicant.conf and others? Is there somewhere an instruction?

Moreover, i'm totally unsure regard /usr/local/etc ...

Thanks a lot in advance for any pointer!

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: some cleanup questions
« Reply #1 on: December 22, 2015, 06:47:52 PM »
...
For /etc you see i only protect the files in it (not any directory), but i'm unsure which ones really need to be protected and which ones not.
...
This is severely over complicating the issue..  if you loose configurations then so be it, better and more efficient to find those conf files responsible which require backup, then backup only those files.   Keep it Simple..     I'd recommend removing all those etc related directory entries from both filetool.lst and xfiletool.lst  then backup only those specific files you've purposely and intentionally configured specifically for your system.    I don't know how to be more clear on that..

Keeping it simple means backing up a directory which only contains files you has configured or if it contains anything else then better to backup specific files only.

good luck


Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: some cleanup questions
« Reply #2 on: December 23, 2015, 12:02:45 AM »
Keep in mind that  /etc/hosts  is recreated at boot by  /usr/bin/sethostname , so it needs to be edited after that happened.
For example in bootsync.sh
Code: [Select]
cat /etc/my-hosts >> /etc/hosts
Download a copy and keep it handy: Core book ;)

Offline emninger

  • Sr. Member
  • ****
  • Posts: 267
Re: some cleanup questions
« Reply #3 on: December 23, 2015, 08:32:29 AM »
Thanks for the excellent advice. I've a question as for bootsync.sh:

My actual bootsync.sh looks like this:
Code: [Select]
/usr/bin/sethostname box
/opt/bootlocal.sh &

Is that correct that there is no "&"  after the first line? Following your advice i'd have to add a line in the middle i presume:
Code: [Select]
/usr/bin/sethostname box
cat /home/tc/blocklist >> /etc/hosts
/opt/bootlocal.sh &

Is that correct? Or with an ampersand at the end?

TIA!

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: some cleanup questions
« Reply #4 on: December 23, 2015, 09:00:22 AM »
Using an ampersand (&) to prevent further 'delay' wouldn't hurt.
Download a copy and keep it handy: Core book ;)

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11178
Re: some cleanup questions
« Reply #5 on: December 23, 2015, 09:30:27 AM »
Hi emninger
Using an ampersand (&) to prevent further 'delay' wouldn't hurt.

Using an ampersand will place a task into the background and make it run asynchronously. When multiple tasks are
placed into the background, there is no guarantee that the first task will finish before the next task starts. If the second
task depends on the first task, you may find yourself in a situation where sometimes things work properly and
sometimes they don't. You want  sethostname  to complete before  /etc/hosts  gets modified. If anything in  bootlocal.sh
depends on  /etc/hosts  , you want to be sure the  cat  command completes before  bootlocal.sh  is called.

Offline emninger

  • Sr. Member
  • ****
  • Posts: 267
Re: some cleanup questions
« Reply #6 on: December 23, 2015, 09:39:44 AM »
If i understand right: Without an ampersand the commands are done "step by step", one after the other. If not, executing could be overlapping (and sometimes create errors)?

PS. Maybe you gave me right now, the explanation, why, sometimes, one of my 2 conkys i'm running (one sysinfo, one weather forecast) does not come up. Without any logic and explanation (i played around a lot with the sleep option instead). Great, now i know where and how to look at this!

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11178
Re: some cleanup questions
« Reply #7 on: December 23, 2015, 09:45:35 AM »
Hi emninger
If i understand right: Without an ampersand the commands are done "step by step", one after the other. If not, executing could be overlapping (and sometimes create errors)?

That's correct.

Offline emninger

  • Sr. Member
  • ****
  • Posts: 267
Re: some cleanup questions
« Reply #8 on: December 27, 2015, 12:19:32 AM »
...
For /etc you see i only protect the files in it (not any directory), but i'm unsure which ones really need to be protected and which ones not.
...
This is severely over complicating the issue..  if you loose configurations then so be it, better and more efficient to find those conf files responsible which require backup, then backup only those files.   Keep it Simple..     I'd recommend removing all those etc related directory entries from both filetool.lst and xfiletool.lst  then backup only those specific files you've purposely and intentionally configured specifically for your system.    I don't know how to be more clear on that..

Keeping it simple means backing up a directory which only contains files you has configured or if it contains anything else then better to backup specific files only.

good luck

I did dare to follow your advices and, voilĂ , it worked - as far as i see in this moment ... :D Thanks a lot for your patience!

Now my .filetool.lst looks like this:
Code: [Select]
etc/gshadow
etc/passwd
etc/passwd-
etc/shadow
etc/shadow-
etc/adobe/mms.cfg
usr/local/etc/laptop-mode/laptop-mode.conf
usr/local/etc/laptop-mode/conf.d/usb-autosuspend.conf
usr/local/share/X11/xorg.conf.d/10-keyboard.conf
usr/local/etc/cups/ppd/HP_Deskjet_3900.ppd
usr/local/etc/cups/printers.conf
usr/local/etc/cups/cupsd.conf
usr/local/var/log/tor

and my .xfiletool.lst:
Code: [Select]
Cache
cache
.cache
XUL.mfasl
XPC.mfasl
mnt
.adobe/Flash_Player/AssetCache
.macromedia/Flash_Player
.opera/opcache
.opera/cache4
.Xauthority
.wmx

Does that seem correct, now?

Btw, i noticed a small problem: In the graphical control panel > Backup/Restore i was unable to delete item as well as to clear item (what's the difference between them both?). I had to edit .(x)filetool.lst by hand (i.e. by the editor). Where should i look to correct that?

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
some cleanup questions
« Reply #9 on: December 27, 2015, 11:59:38 AM »
Much better, good job..   Also if you don't really need the backup copies you could also delete the files with the tilde attached :)


Sent from my iPhone using Tapatalk

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: some cleanup questions
« Reply #10 on: December 27, 2015, 12:22:50 PM »
As I get it, "Clear Item" just means 'de-select anything' so the "Add" button gets active again.
Not sure why you can't "Delete Item". Are  /opt/.filetool.lst  and  /opt/.xfiletool.lst  owned by  root:root  or something else than  -rw-rw-r-- ?
Download a copy and keep it handy: Core book ;)

Offline emninger

  • Sr. Member
  • ****
  • Posts: 267
Re: some cleanup questions
« Reply #11 on: December 27, 2015, 03:07:00 PM »
No, they are owned by user (tc) and they are marked correctly.