How to include only specific folders in save file?

Booting, installing, newbie
Post Reply
Message
Author
komet
Posts: 6
Joined: Wed 12 Dec 2012, 12:01

How to include only specific folders in save file?

#1 Post by komet »

I would like to be able to specify which folders to include with the save file. I find that over time, that save file fills up with random junk (logs I guess) which I do not want. What I would like to do is have a script run at the first shutdown and ask me to either list the directories that I want to include in the save file, or select to include all directories.
I think that this would eliminate my save file filling up with random logs. Pussy Linux includes this option already, but I would like to have this in Slacko.
Link to Pussy Linux:http://www.murga-linux.com/puppy/viewto ... c85026ce9b
The ability to specify what directories are "persistent" by editing one config file is introduced. Default behavior is all dirs are "persistent" but its possible to have only one dir like /root or /home or /myfiles set as "persistent". This can save space and clutter because it lets the user avoid keeping 1000 log files that get updated in the boot process from invading your save file or partition.
Thank you for your help.
P.S. I run Slacko 5.5 if that is helpful.

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#2 Post by Flash »

I don't know the answer to your question, but I do know that your browser's cache is probably the culprit that's filling up your Save file. The solution is to get the browser to keep its cache in /tmp so that the cache is not saved. Which browser do you use? If it's SeaMonkey, there's an easy way to tell it to put its cache in /tmp. I also know that it's possible to tell Firefox to keep its cache in /tmp.

Another possible culprit is email. Most email clients do not actually delete an email, but only move it to a hidden place. If you download your email, and you get a lot of it, then deleted emails could be piling up somewhere in your Save file. That's less likely to be the problem than your browser's cache though.

Peterm321
Posts: 411
Joined: Thu 29 Jan 2009, 14:09
Location: UK

#3 Post by Peterm321 »

komet Today at 03:58 wrote:What I would like to do is have a script run at the first shutdown and ask me to either list the directories that I want to include in the save file, or select to include all directories.
I havent looked into the internals of Slacko or other versions and if or how they might implement such a proposed or existing function. I use Wary as a full HD and Raring running in RAM so a save file is not something I use. You may want to consider posting to one of the Slacko threads.

What I could state is that there must be many workarounds that could be used. One way would be to find where the logfiles etc are and delete them at or before shutdown, I imagine a simple script to delete them is possible.

Suppose there are many logs or temp files in a directory in for example, /mnt/home/logs then getting rid of all the files in that directory could be had by running a short script:

Code: Select all

rm -rf /mnt/home/logs/*
Before shutdown.

My own preference, though, is to use the mount --bind comand to overlay directories that contain temporary logs or other files only intended to last for the current session (and not to be kept) to the /tmp filesystem which is usually mounted to ram and is lost at reboot.

Overlaying a persistent directory to /tmp involves copying the directory to /tmp and running mount --bind. So, if the directory concerned is /mnt/home/logs then copy it to /tmp


Code: Select all

mkdir -p /tmp/mnt/home/logs
cp  -r   /mnt/home/logs/* /tmp/mnt/home/logs
mount   --bind    /tmp/mnt/home/logs /mnt/home/logs
From then on any changes to /mnt/home/logs are transparently remapped to /tmp/mnt/home/logs and will be gone at poweroff/reboot if /tmp is mounted as a tmpfs system.

Its the method I use to, for example, stop changes to configurations in $HOME/.config e.g. emelfm2 filemanager etc lasting across sessions. Using mount --bind is a personal choice for me that might not suit everybody.

Sylvander
Posts: 4416
Joined: Mon 15 Dec 2008, 11:06
Location: West Lothian, Scotland, UK

Re: How to include only specific folders in save file?

#4 Post by Sylvander »

komet wrote:I find that over time, that save file fills up with random junk (logs I guess) which I do not want.
1. The method I use to to eliminate this, and other problems also [possibility of infection/corruption?], is...
a. I make some changes to the Puppy so it does NOT auto-save session changes back to the pupsave...
Neither during the session, nor at shutdown/reboot.
b. I can choose to manually save specific changes [a program install or config change?] during the session, and not save following changes...
Or choose to reboot, and choose to save changes [or NOT] during that reboot.
c. Hence, I have control over what does [and does not] get saved.
Most of the time, I go with the default, to NOT SAVE ANY CHANGES. :D

2. There are various methods available to achieve the above effect [they are out there on the forum postings].
If you are interested in the method, just say so.

Post Reply