I'm going to be running an Ubuntu 14.04 LTS server that will have a few Garry's Mod (Half-life 2/Source based) servers running on it. I don't want any one of those servers getting out of line by taking up too much RAM or CPU. If any server uses over 1 gig of RAM or 100% of 1 CPU core, I'd like it to automatically restart. In addition to this, is there a way to automatically restart each of these applications daily, say at 12 am?
I'm very new to bash scripting and know little, but if someone could atleast point me in the right direction that would be greatly appreciated.