Originally Posted by bowser4
Hi folks, I've posted in the newbie section as I'm relatively new to Linux, but thoroughly enjoying the learning curve. I'm running Lubuntu on an ancient laptop and I'm after a script which will run on booting, which will make the laptop reboot every couple of hours, and make a program run as root each time (yes, I know the dangers of running as root). Is such a thing possible?
Very possible. You'd have to kick the script off as root, and you could either use cron or at to schedule the job. Linux has a "reboot" command, and the shutdown command has options too (type in "man shutdown" for a list). So, construct your script to reboot using either method, after scheduling it to run again at whatever interval you want. You can either shove a line into crontab manually (since you're rebooting, cron will restart and pick up the new job), or use at to re-run the script.
An at job gives you a bit more flexibility, since you can say things like "at now + 2 hours /some/script", and it will run two hours from now.