Posted: Sat 13 Aug 2005, 15:56 Post subject:
How can I save to pup001 file on a schedule?

I have Puppy running in RAM and often do not reboot for days, so a sudden power outage (like my kids pushing the reset button) could cause me to loose a lot of work. I would like a little script that would save everything back to the pup001 file like the rc.reboot script does, but without rebooting. I looked at stripping that script down but I'm not quite sure what all of it does. Does anybody have any advise to get me started? Thanks

I presume you're booting off usb, so all of pupxxx got copied onto ramdisk?

If so, yeah, a big button on the desktop to do that, or even an automatic thing that does it every say 5 minutes ...Puppy does have a background daemon script called "check_space" that could be extended to do this.

This is on my to-do list, maybe it will interest somebody.
/tmp/rc.reboot has the shutdown script, need the code out of there to see how writing back to pupxxx file is done.

Actually I have it installed onto the hard drive but have it loading into RAM as discussed here. It's the same basic set up as booting from a USB drive. I wouldn't mind writing or modifying the script, but I'm not sure what all the script is doing. I'm guessing that this is the place to start.

Actually I have it installed onto the hard drive but have it loading into RAM as discussed here. It's the same basic set up as booting from a USB drive. I wouldn't mind writing or modifying the script, but I'm not sure what all the script is doing. I'm guessing that this is the place to start.

[cut]

I don't interpret anything written in the posts at the link you referenced as loading pupxxx file to RAM. As near as I can read it, pupxxx is sitting on the hard disk and being written to each time you save your work. I could be wrong, that's why I have a ?

I could be wrong, but I believe that the line root=/dev/ram0 ramdisk_size=16384 loads Puppy into RAM. I know that if I create a file and save it, the file is gone if I suddenly loose power to the computer or if I press the reset button. If I do a proper shut down the file is still there when it boots back up.

I could be wrong but I think your pupxxx file is being used from the hard disk.

How about making a quick calculation by booting the computer and running the free command. I think you will be able to roughly calculate if there is a 256 MB* pupxxx file sitting in RAM along with the other files from image.gz, usr_cram.fs and normal system usage.

It appears like your pupxxx is in RAM huh? It is in RAM you better come up with a way of periodically saving files

I think an option 1 typically fits together simplistically something like this:

/bin/ files are in RAM - generated each boot by image.gz
/dev/ files are in RAM - generated each boot by image.gz
/etc@ files are on hard disk inside pupxxx
/lib/ files are in RAM - generated each boot by image.gz
/mnt/ the mount points are generated each boot by image.gz
/proc/ files in RAM generated by the system
/root/ the mounted pupxxx
/sbin/ files are in RAM - generated each boot by image.gz
/tmp/ created by image.gz and used by various process throughout the session
/var/ is generated by image.gz and possibly added to during the session - all is lost on reboot
/usr/ files are in RAM - generated each boot by usr_cram.fs
AND
/usr/ is also from the pupxxx file at /root/.usr and as far as precedence and priority it
rates high, meaning whatever is in /root/.usr has presedence to what was in usr_cram.fs when
it was loaded.

Edit note: the only significant difference between the GRUB instructions I've been using and the ones in the thread is the ramdisksize. I figured that was more for making sure there was adequate space to expand image.gz

I know that if I create a file and save it, the file is gone if I suddenly loose power to the computer or if I press the reset button. If I do a proper shut down the file is still there when it boots back up.

Probably a stupid idea but is it not possible to reboot via a cron job so all your stuff gets kicked out to disk?

Probably a stupid idea but is it not possible to reboot via a cron job so all your stuff gets kicked out to disk?

I think that cron is a great idea. It has been on my to-do list. I would just have it run a "save-to-disk" script rather than the reboot script though. My problem is getting the right save-to-disk script.

The problem could be time in this. If you have a larger pupXXX it needs some time to copy the whole thing to an USB stick.

Idea:
Let not really copy the thing, just check for differences.

1. Poorman's way: do a cp with the -u (update, just copies newer files)
2. Geek's way: Install fam (file alternation monitor), which checks for any change in a specified directory (here /root) and let a script react on this. Advantage: a little bit safer (does not depend on correct timestamp ) and less overhead, if there are a lot of files.

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot vote in polls in this forumYou cannot attach files in this forumYou can download files in this forum