Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to save a Pharo image automatically every hour?

I want to save my Pharo image every hour on the hour automatically.

How would you make this automatic within the image?

I've seen the Pier project do this. But I'm not sure how they do it.

TIA

like image 253
elviejo79 Avatar asked Jan 11 '11 08:01

elviejo79


1 Answers

There is the Scheduler project on SqueakSource that looks like cron for Smalltalk. From the overview:

"Start a new task scheduler and keep it around"
scheduler := TaskScheduler new.
scheduler start.
"Let's save the image every hour"
scheduler
   do: [Smalltalk snapshot: true andQuit: false]
   every: 60 minutes.

You could combine that with the blocking code or OSProcess's saveImageInBackgroundNicely mentioned above and have a nice easy solution.

like image 105
Sean DeNigris Avatar answered Nov 13 '22 07:11

Sean DeNigris