Tiny Core Linux

Tiny Core Base => TCB Talk => Topic started by: jls on May 28, 2009, 05:01:41 PM

Title: plz delete the home during shutdown in case is in filetool and persistent
Post by: jls on May 28, 2009, 05:01:41 PM
Hi
I would suggest to delete the home during the shutdown process in case is in filetool and persistent.




no state no jail
Title: Re: plz delete the home during shutdown in case is in filetool and persistent
Post by: jls on May 28, 2009, 07:39:04 PM
same story for persistent opt
Title: Re: plz delete the home during shutdown in case is in filetool and persistent
Post by: roberts on May 28, 2009, 08:02:42 PM
I think this has been brought up before.

My position on this matter is that the two files that control backups, /opt/.filetool.lst and /opt/.xfiletool.lst
are under the control of the user.

From a system standpoint I would not delete anything from either one. As the user of your system you can wish to include/exclude any file or directory that you choose. It would become very confusing if the 'standard' varied.

Just because one chooses to run with some persistent options does not mean that those areas should never be in a backup.
Title: Re: plz delete the home during shutdown in case is in filetool and persistent
Post by: junan on May 28, 2009, 11:15:54 PM
maybe u need to reconfigure your xfiletool.lst
or remove some directory link from your filetool.lst
backup always important  :)
Title: Re: plz delete the home during shutdown in case is in filetool and persistent
Post by: jls on May 29, 2009, 04:35:27 AM
U friends are not undestanding what I wanted to intend.
The system shouldn't touch filetool or xfiletool, but it should look inside filetool to see if the user is saving his home, if yes, during the shutdown process the home should be deleted from where it is: hard drive, pen drive. This is just in case of persistent home.
Infact, in case of non persistent home, the home is in ram and on shutdown automatically vanishes.
I use persistent home cause my pcs are old and also for not having data loss in case of black out.
Bu I want my system to be portable, so I included /home/tc in my filetool. The problem is when I repoweron 1 of my pcs, the home inside mydata is mixed with the one that's already in my hard disks, and this is not good.
Am I clear now?

sorry again for my english, which now is better then before, anyway
Title: Re: plz delete the home during shutdown in case is in filetool and persistent
Post by: Guy on May 29, 2009, 05:05:11 AM
If I understand you, this is a problem when one is changed and not the other. For example, when you use a USB drive in a different computer.

If I that is the case, a possible solution to consider.

If you boot from Grub, make two different boot options in Grub, one where home is loaded, and the other where home is not loaded. When you use it in another computer, use the option where home is not loaded. You can still access home using the file manager.

Does this help?
Title: Re: plz delete the home during shutdown in case is in filetool and persistent
Post by: alu on May 29, 2009, 09:44:04 AM
what about multiple directories with your mydata and tce apps? exemple: sometimes, i have to use tc-1.4 in order to chat on skype, nevertheless, i want to keep both tc-1.4 and tc-2.0rc3 on my usb-pendrive with appropriate apps; what i did is the following:

1. create a tc-1.4 directory with tce/z apps and one mydata.gz file;
2. create another tc-2.0 directory with tce/z apps for tc-2 and another mydata.gz file;
3. if i want to run tc-1.4, i just have to point my syslinux.cfg to the right directory; if i want tc-2, i modify syslinux.cfg;
4. at boot, i type cheat codes in order for TC to load the appropriate apps and the appropriate mydata.gz file (f.ex.: tce=sda1/tc-2/tce restore=sda1/tc-2)

you can probably apply this solution with variations depending on your needs.
Title: Re: plz delete the home during shutdown in case is in filetool and persistent
Post by: roberts on May 29, 2009, 10:41:15 AM
jls,

What you are propsing would not be persistent.
The point of specifying a persistent home was to often times avoid a backup or at most have a much reduced backup (sans /home/tc). Of course this meant to adjust .filetool.sh/.xfiletool.sh

Since TC is all about choices and if you wish to modify to suit your particular needs, you want to add such deletion after a sucessful backup. Check out /usr/bin/exitcheck.sh.  I really don't recommend this unless you really know what you are doing. Make your custom exitcheck.sh into a tce.

Title: Re: plz delete the home during shutdown in case is in filetool and persistent
Post by: jls on May 29, 2009, 12:04:34 PM
so what do u recommend for my particular situation?
I don't think it's particular or maybe we are few people using this distro.
I don't think it's good for my pcs to have a non persistent home which at the moment is 49MB (I know I should reduce it (I actually also have a .local hyerarchy which I could make an extension out of it)).
I also thought to modify exitcheck.sh, maybe I'll do, but I would like to hear also some other opinions from the other users.
Title: Re: plz delete the home during shutdown in case is in filetool and persistent
Post by: jls on May 29, 2009, 12:37:32 PM
my problem could be solved also deleting the persistent home during the startup process, for recreating a sane one from mydata
Title: Re: plz delete the home during shutdown in case is in filetool and persistent
Post by: jls on May 29, 2009, 04:18:36 PM
ok, I made the below script:
Code: [Select]
#!/bin/sh
#removes the eventual persistent home if exists and is listed in /opt/.filetool.lst
#called from exitcheck.sh
#copyleft jls_legalize (unsenepopiu at tin dot it)

. /etc/init.d/tc-functions

for i in `cat /proc/cmdline`; do
case $i in
*=*)
case $i in
home*) MYHOME=${i#*=};;
user*) USER=${i#*=} ;;
esac
esac
done
if [ $MYHOME ]; then
[ $USER ] || MYHOME=tc
for i in `cat /opt/.filetool.lst`; do
if [ $i == "home/tc" ]; then
echo -n "${BLUE}removing ${MAGENTA}/mnt/$MYHOME/home/$USER"
sudo rm -rf /mnt/$MYHOME/home/$USER/* /mnt/$MYHOME/home/$USER/.[!.] /mnt/$MYHOME/home/$USER/.??* &
rotdash $!
sync
exit 1
fi
done
fi
Title: Re: plz delete the home during shutdown in case is in filetool and persistent
Post by: mikshaw on May 29, 2009, 10:18:01 PM
I guess I understand what you hope for, but I agree with robert that this behavior would be an odd thing to have in TC base.  If you have  persistent home that would typically mean that this particular installation is not intended to be portable.  The portable system would seem to imply that your persistency  comes in the form of mydata, and just assuming that you want to delete home because it's in filetool.lst is likely to cause a lot of trouble.  For example, I don't use backup/restore, and I do use a peristent home.  I haven't made any change to the default filetool.lst, which by default includes /home/tc. Your script would seriously tick me off if it ran on my system, since I'd lose everything
Title: Re: plz delete the home during shutdown in case is in filetool and persistent
Post by: jpeters on May 30, 2009, 02:22:36 AM
I haven't made any change to the default filetool.lst, which by default includes /home/tc. Your script would seriously tick me off if it ran on my system, since I'd lose everything
:D
Title: Re: plz delete the home during shutdown in case is in filetool and persistent
Post by: jls on May 30, 2009, 08:30:30 AM
I've modified my script, see the post above, so now it doesn't delete the home but only it's content, and I've also added rotdash $! and sync which I've copied from filetool.sh.
put this line:
Code: [Select]
aterm +tr +sb -bg white -fg black -geometry 80x3 -e persistent_home_removalin exitxhech.sh before the ACTION="$1" line
Also posted in the wiki