Other Help Topics :: How do I make DSL shut down at a certain time?
OK, I have a question. How would I go about setting up DSL to shut down at say... 7:30 PM. My computer clock is set right. I believe I have cron installed from a debian package. I am running apache and a website on an old pentium comp that runs well and does what it should. THis is an older computer that doesn't turn off on it's own because you have to hit the poser button (the power button is really a switch). I'm planning to put a timer on the surge protector so the following will occur: 6:00 AM timer turns on surge protector and computer turns on 7:30 PM computer turns off 7:40 PM timer turns off surge protector to complete the shutdown
I can get a timer, but how do I schedule a shutdown?Google help cron and linux shutdown.
If dsl has "shutdown" you can put the time in that, but for regular use, cron would be best I think.you mean putting a shutdown command in the bootlocal.sh and setting the seconds to the huge number representing the time when it should turn off? that would work...
THanks for your help. Any other ideas appreciated while I play with this.EDIT: reread message and revised answer
You need to make a crontab file. To do this, open a bash shell and type:
export VISUAL=beaver
to use beaver as your crontab editor. You could use any editor you want. Now edit a crontab file by typing crontab -e Here is an example crontab file that shuts down every day at 8:00:
Code Sample
30 19 * * * sudo shutdown
# minute (0-59 or *) 30 = minutute = 30 ...# hour (0-23 or *) 19 = 7 PM ......# day (1-31 or *) * = everyday ........# month (1-12 or *) * = every month ...........# day of week (0-6 6=Sunday) * = every day of the week
view your crontab file using crontab -lYou will also need to install a cron server, because DSL doesn't have one.
Use the search function at packages.debian.org to look at the different available crons and choose one that will suit you.Next Page...
original here.