How to save only on command?

What features/apps/bugfixes needed in a future Puppy
Message
Author
User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#21 Post by Karl Godt »

....mike looks around the thread for karl.......
Hi Mike !

Hmmm ... that theme had been posted a lot of times , but not recently .

Basically the solution found by other members was to set the save interval to 0 in the eventmanager gui and add few lines into /etc/rc.d/rc.shutdown

to present a dialog asking to save session or not into the save file like :

Code: Select all

function_ask_to_save(){
dialog --yesno "Save the trash from /initrd/pup_rw into /initrd/pup_ro1?" 0 0
if [ "$?" = 0 ] ; then
:
else
unset PUPMODE
PUPMODE=5 
fi
}
And such function needs to be called somewhere at or before

#save session...
case $PUPMODE in
3) #PDEV1.
echo "Saving session to $PDEV1..." >/dev/console
/usr/sbin/snapmergepuppy /initrd/pup_ro1 /initrd/pup_rw
;;
[ .. ]
5) #v2.02 first boot.
echo "Session not saved" >/dev/console
sync
#ha ha, before had this, if aborted save after choosing save-partition, code
#further down wiped all of the partition (it was mntd on /tmp/savepup)...
[ ! "$SMNTPT" = "" ] && umount $SMNTPT
#...well, fixed it, changed mntpt so not in /tmp. Leave above line here.
;;
*)
echo "Session not saved" >/dev/console
sleep 2
;;
esac

or probably in every PUPMODE case .. in rc.shutdown .

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#22 Post by mikeb »

Hi karl
The day I removed snapmergepuppy was a happy one.
It does not really do the job that well and IIRC never got to do a proper ram flush either. pupmode=13 is a distant memory.

mike

Post Reply