WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: plz delete the home during shutdown in case is in filetool and persistent  (Read 6956 times)

Offline jls

  • Hero Member
  • *****
  • Posts: 2135
Hi
I would suggest to delete the home during the shutdown process in case is in filetool and persistent.




no state no jail
dCore user

Offline jls

  • Hero Member
  • *****
  • Posts: 2135
same story for persistent opt
dCore user

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
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.
10+ Years Contributing to Linux Open Source Projects.

Offline junan

  • Jr. Member
  • **
  • Posts: 88
maybe u need to reconfigure your xfiletool.lst
or remove some directory link from your filetool.lst
backup always important  :)
fun and fearless ...

Offline jls

  • Hero Member
  • *****
  • Posts: 2135
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
dCore user

Offline Guy

  • Hero Member
  • *****
  • Posts: 1089
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?
Many people see what is. Some people see what can be, and make a difference.

Offline alu

  • Sr. Member
  • ****
  • Posts: 429
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.

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
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.

10+ Years Contributing to Linux Open Source Projects.

Offline jls

  • Hero Member
  • *****
  • Posts: 2135
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.
dCore user

Offline jls

  • Hero Member
  • *****
  • Posts: 2135
my problem could be solved also deleting the persistent home during the startup process, for recreating a sane one from mydata
dCore user

Offline jls

  • Hero Member
  • *****
  • Posts: 2135
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
« Last Edit: May 30, 2009, 08:27:12 AM by jls_legalize »
dCore user

Offline mikshaw

  • Sr. Member
  • ****
  • Posts: 368
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

Offline jpeters

  • Restricted
  • Hero Member
  • *****
  • Posts: 1017
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

Offline jls

  • Hero Member
  • *****
  • Posts: 2135
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
« Last Edit: May 31, 2009, 10:03:47 AM by jls_legalize »
dCore user