Timing Your Own Auto-Save To Flash

Post here if you are a new Porteus member and you're looking for some help.
Post Reply
jimwg
Shogun
Shogun
Posts: 322
Joined: 09 Oct 2013, 18:15
Distribution: porteus
Location: NYC

Timing Your Own Auto-Save To Flash

Post#1 by jimwg » 17 Jan 2014, 13:37

Greetings;

I think it's little obscure if there's a method, but how do you set your own time period for Porteus to auto save/back-up data in RAM to your flash?

Thanks

Jim in NYC

User avatar
brokenman
Site Admin
Site Admin
Posts: 5460
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v3.2rcX all desktops
Location: Brazil
Contact:

Re: Timing Your Own Auto-Save To Flash

Post#2 by brokenman » 17 Jan 2014, 15:59

From the cheatcodes.txt file:
While you are running a session with changes=EXIT, you can use the
'dump-session' command (run as root from the command line) to move all
of your changes from RAM to your storage media. This will reduce the
risk of data loss and free up your RAM.
So you may use whatever method you prefer to run the command dump-session at your chosen interval.

You may use cron by creating a file /etc/cron.d/dumpmysession with the following.

Code: Select all

*/15 * * * * DISPLAY=:0.0 dump-session >/dev/null
This will dump your session every 15 minutes.

Or by placing somescript like this in your startup:

Code: Select all

let counter=$counter+1
if [ $counter == 600 ]; then /usr/bin/dump-session; $counter=0; fi
Lastly my choice would be a keyboard shortcut (differs per DE) to run the command: dump-session (This would require a password if running as guest)

EDIT: This is how i handle the stopping of cronjobs on my home machine:
ps -o pid,sess,cmd afx | grep -A20 "cron$"
Then look for the PID (first column of output) and issue:
pkill -s (PID of your cronjob)
How do i become super user?
Wear your underpants on the outside and put on a cape.

jimwg
Shogun
Shogun
Posts: 322
Joined: 09 Oct 2013, 18:15
Distribution: porteus
Location: NYC

Re: Timing Your Own Auto-Save To Flash

Post#3 by jimwg » 18 Jan 2014, 11:54

Thanks for all the recommendations! The only thing is I'm a "seasoned newbie" thanks to your guys and my Amiga past. What about the "newbie-newbie" taking a taste of Porteus and at risk of being put-off by techie-tinkkering to get something done? Is it possible to create a "Cheatcode GUI" or script builder function template akin to the Porteus Settings Center System settings for Time configuration to look and act less techie and more newbie friendly?

Thanks!

Jim in NYC

User avatar
brokenman
Site Admin
Site Admin
Posts: 5460
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v3.2rcX all desktops
Location: Brazil
Contact:

Re: Timing Your Own Auto-Save To Flash

Post#4 by brokenman » 18 Jan 2014, 13:01

Of course something can be added to a GUI. Your question did not sound like a feature request and therefore i answered with the simplest method known using the tools available.

There are various linux cron job creators with a gui available. Even one for slackware. It shouldn't be too difficult to add something to PSC so i will put it on the TODO list. For now you can create your own cronjobs here:
http://www.corntab.com/pages/crontab-gui and then open a terminal and su to root:

Code: Select all

su
toor
crontab -e
Now you need to paste your command created from the site above into the crontab (the terminal screen). This will depend on the terminal that you are using but probably holding down 'ctrl' and 'shift' together and then hitting 'v' should do it.

PS: I am currently working on an easier way for users to build packages from a .SlackBuild file on Porteus.
How do i become super user?
Wear your underpants on the outside and put on a cape.

jimwg
Shogun
Shogun
Posts: 322
Joined: 09 Oct 2013, 18:15
Distribution: porteus
Location: NYC

Re: Timing Your Own Auto-Save To Flash

Post#5 by jimwg » 19 Jan 2014, 00:21

brokenman wrote:Of course something can be added to a GUI. Your question did not sound like a feature request and therefore i answered with the simplest method known using the tools available.

There are various linux cron job creators with a gui available. Even one for slackware. It shouldn't be too difficult to add something to PSC so i will put it on the TODO list. For now you can create your own cronjobs here:
http://www.corntab.com/pages/crontab-gui and then open a terminal and su to root:

Code: Select all

su
toor
crontab -e
Now you need to paste your command created from the site above into the crontab (the terminal screen). This will depend on the terminal that you are using but probably holding down 'ctrl' and 'shift' together and then hitting 'v' should do it.

PS: I am currently working on an easier way for users to build packages from a .SlackBuild file on Porteus.
Thanks! So great to know that you're already on top of the need! Thanks! :)

Jim in NYC

Post Reply