SavePuppy - click to save session (to USB only)

Stuff that has yet to be sorted into a category.
Post Reply
Message
Author
User avatar
Pizzasgood
Posts: 6183
Joined: Wed 04 May 2005, 20:28
Location: Knoxville, TN, USA

SavePuppy - click to save session (to USB only)

#1 Post by Pizzasgood »

This is a roxapp for people with Puppy installed to usb (or who are otherwise in pupmode 13 for some reason, like me). As you may know, Puppy will not save back to the usb continuously in order to preserve its life. What it does is save every thirty minutes and when you reboot. But what about if you just did something important? That's what this is for. If you click it, it will save your Puppy immediately.

This will install to /root/my-roxapps/SavePuppy. To uninstall, just delete it. Simple as that.

SavePuppy.pup

Note: This is NOT for multisession. It is for USB and mode 13. Check /etc/rc.d/pupstate (or pupmode with older Puppies) to check your mode.

EDIT: updated on 2-04-2007 with cleaned-up code and a better sanity check. The old one will still work just fine, don't worry about upgrading. :wink:
Last edited by Pizzasgood on Mon 05 Feb 2007, 00:32, edited 3 times in total.
[size=75]Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib[/size]
[img]http://www.browserloadofcoolness.com/sig.png[/img]

pmshah
Posts: 84
Joined: Thu 31 Aug 2006, 07:26
Location: India

Don't need to worry

#2 Post by pmshah »

The flash memory chips are supposed to allow you a minimum of 50,000 cycles of erase & rewrite. A least that is rthe specification I gor with my toshiba nedia with Casio digicam.

At this rate unless one goes overboard with it your USB drives should last you at least for 4-5 years.

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

#3 Post by Flash »

50,000 would be a very conservative minimum guarantee. From what I've been able to find, flash memory typically lasts 100,000 cycles before it begins to fade, and doesn't become useless until it has been written to and erased a million times.

One way flash memory is superior to a hard drive is that it fails slowly due to gradually increasing errors, rather than suddenly with a loud screech and a puff of smoke. :lol:

User avatar
Pizzasgood
Posts: 6183
Joined: Wed 04 May 2005, 20:28
Location: Knoxville, TN, USA

#4 Post by Pizzasgood »

Then you take into account that that is for each sector, not the entire thing as a whole. So my new 1GB flash Ogg-player will last for 100 terabytes of data before it starts to degrade (no, I haven't installed Puppy to it. I considered it, but I need the entire gigabyte for music)
[size=75]Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib[/size]
[img]http://www.browserloadofcoolness.com/sig.png[/img]

vern72023
Posts: 158
Joined: Mon 26 Dec 2005, 05:15
Location: Jacksonville Fl

#5 Post by vern72023 »

i like this little app - but modified it by adding the following 2 lines just prior to the save current session
#Backup Puppy
cp /mnt/home/pup_save.3fs /mnt/home/pup_save.bak.3fs
that way i get a backup in case i really messup
george

User avatar
Dougal
Posts: 2502
Joined: Wed 19 Oct 2005, 13:06
Location: Hell more grotesque than any medieval woodcut

#6 Post by Dougal »

vern72023 wrote:#Backup Puppy
cp /mnt/home/pup_save.3fs /mnt/home/pup_save.bak.3fs
that way i get a backup in case i really messup
You should probably make it "cp -f", so that on subsequent saves (when there's already the .bak) it'll still work.
What's the ugliest part of your body?
Some say your nose
Some say your toes
But I think it's your mind

User avatar
Pizzasgood
Posts: 6183
Joined: Wed 04 May 2005, 20:28
Location: Knoxville, TN, USA

#7 Post by Pizzasgood »

It does it anyways.

Code: Select all

sh-3.00# cat a
Cheese
sh-3.00# cat b
Cake
sh-3.00# cp b a
sh-3.00# cat a
Cake
sh-3.00# 
Though -f might be safer in terms of portability.
[size=75]Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib[/size]
[img]http://www.browserloadofcoolness.com/sig.png[/img]

User avatar
Black_64
Posts: 53
Joined: Tue 12 Sep 2006, 17:58

#8 Post by Black_64 »

vern72023 wrote:i like this little app - but modified it by adding the following 2 lines just prior to the save current session
#Backup Puppy
cp /mnt/home/pup_save.3fs /mnt/home/pup_save.bak.3fs
that way i get a backup in case i really messup
Is this working on Puppy 2.11? Because i dont have /mnt/home/pup_save.3fs

vern72023
Posts: 158
Joined: Mon 26 Dec 2005, 05:15
Location: Jacksonville Fl

#9 Post by vern72023 »

you are probably using a different installation method
I use either usb or frugal installs
and it works fine in 212 now as well except I called my pup pup_save.212.3fs so that i could run the 211 and 212 parallel
I have a linuz11, initrd11.gz and pup_save.211.3fs and a linuz12;initrd12.gz, pup_save.212.3fs and in syslinux.config can flip between the 2
label 2
kernel linuz11
append root=/dev/ram0 initrd=initrd11.gz PMEDIA=usbflash quiet
label 3
kernel linuz12
append root=/dev/ram0 initrd=initrd12.gz PMEDIA=usbflash quiet

thought now I think i will be getting rid of the 211 as the latest 212 seems very stable

george
george

User avatar
Black_64
Posts: 53
Joined: Tue 12 Sep 2006, 17:58

#10 Post by Black_64 »

Ok thanks.
How can i find my pup_safe?

User avatar
Pizzasgood
Posts: 6183
Joined: Wed 04 May 2005, 20:28
Location: Knoxville, TN, USA

#11 Post by Pizzasgood »

If you have one, it should be at /initrd/mnt/dev_save/pup_save.3fs. That directory is symlinked to /mnt/home/, so it should also be in /mnt/home/pup_save.3fs.

If it is neither, then you don't have one, which means you are using some other type of installation, not USB or frugal. Multisession and full-hd installs are the only ones I can think of that would not have one. Unless you're just running in ram, without saving your settings.

This script will only work if the /etc/rc.d/PUPSTATE file says you're in PUPMODE=13. It shouldn't be necessary in other versions anyways, as the savefile is mounted directly. All that would be needed in them to make sure everything is saved is opening a terminal and typing sync. Except multisession, of course, which should already have an icon on the desktop for saving it if I remember correctly.
[size=75]Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib[/size]
[img]http://www.browserloadofcoolness.com/sig.png[/img]

User avatar
Black_64
Posts: 53
Joined: Tue 12 Sep 2006, 17:58

#12 Post by Black_64 »

PUPSTATE=13 and puppy is installed on CF-card.
But mine /initrd/mnt/dev_save is empty!
I find a pup_save.3fs in //initrd/mnt/dev_ro1.

What do this mean?

When i type "sync" in a terminal window will this save my current state of puppy to pup_save.3fs?

User avatar
Pizzasgood
Posts: 6183
Joined: Wed 04 May 2005, 20:28
Location: Knoxville, TN, USA

#13 Post by Pizzasgood »

Hmm... I'm not sure of the reason for the different location. Where Puppy mounts things in the initial ramdisk stage is mostly beyond me, but Puppy knows what he's doing. My script should work for you, because it's independent of the locations. All it really is is a hacked and slashed version of the auto-save daemon already in Puppy, so if that works this will work.

As for sync-ing, it will sync any drives mounted, and maybe the ramdisk, but it won't shunt anything into the save-file when using mode 13.
[size=75]Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib[/size]
[img]http://www.browserloadofcoolness.com/sig.png[/img]

User avatar
Black_64
Posts: 53
Joined: Tue 12 Sep 2006, 17:58

#14 Post by Black_64 »

Ok, Thanks

Post Reply