Two weeks ago my son's pedestal computer had this problem - would power up and shut down all by itself continuously with a 30 second frequency.
The Power Supply was failing and sending out Power Not OK signal to the motherboard so the motherboard was shutting everything down except for standby power.
Then after a little time to recover the PSU was changing its mind and sending Power OK to the motherboard and it would all start up again.
A new PSU is ÂŁ40+ My original was 450W but I bought a known-good second-hand 350W supply for ÂŁ20 from a small computer shop. Fitting took about 10 mins.
Computer tower PSUs are often over specified in wattage to allow for lots more peripherals to be added - you do not always need to fit a PSU of the same Wattage rating unless you've added lots of stuff - a hard disk for instance takes about 25W.
If this is Your problem it's a relatively easy fix.
Good luck...
Peccavi
July 2009