Im using Kubuntu 13.04 - by default it just shutdown system, and I want to set it to suspend, to avoid loss of work progress.
How can I do this?
Basically, if you PC overheats and automatically shuts down, this is due to the internal protection from the BIOS, so you won't be able to change this.
What you will be able to do is, either adjust the CPU frequency when the CPU is too hot or suspend or shutdown the PC gracefully, using
You can do this by running a cron job every minute, or using something like computertemp, as suggested by Alexander Burke on the second linked answer.
If it overheats, it is maybe time to clean your PC!