Solved

Schedule a daily shutdown on a slackware box

Posted on 2006-06-21
6
487 Views
Last Modified: 2013-12-16
Hi experts,

i'm working on a mixed network with a file server that us slackware linux (10.2) and some windows based clients.

I need to schedule a daily shutdown of the linux server.
Also, when special needs occurs, i want to cancel the shutdown for a specific day.

I know that this is possible using cron table.

I have a poor knowledge of linux, how can i do this?

Regards.
0
Comment
Question by:balrom
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 22

Accepted Solution

by:
pjedmond earned 50 total points
ID: 16949801
As root:

crontab -e

Edit crontab and add:

0 23 * * * /sbin/shutdown -r now

This will reboot the server at 2300 every day. In order to stop it, then just remove the line, and replace it afterwards.

HTH:)



0
 
LVL 22

Expert Comment

by:pjedmond
ID: 16949809
I'm curious however, as to why you would wish to do this, unless you are saving electricity overnight?
0
 

Author Comment

by:balrom
ID: 16950561
Thanks for your post pjedmond.

I hate vi editing style, can i modify the crontab using mc?

P.S.:
The server is used for a few number of hours each day.
doing this, I'm saving energy and the overall lifetime of the server.
But most important, during the silence of night, the server is very noicy (my office has place in a family shared house (condominium).
0
Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

 
LVL 22

Expert Comment

by:pjedmond
ID: 16951022
You can edit the crontab with any editor you like:

[pje@bigserver root]# VISUAL=/usr/bin/nano
[pje@bigserver root]# export VISUAL
[pje@bigserver root]# crontab -e

if you like namo. I don't use mc, but I guess that it might be possible.

man crontab

for further details.

HTH:)


0
 

Author Comment

by:balrom
ID: 16953522
Thanks a lot  pjedmond.

Your last suggest is working too.

The points are yours.

Regards.
0
 
LVL 22

Expert Comment

by:pjedmond
ID: 16954142
Obviously

/sbin/shutdown -h now

to make it shut down rather than reboot:)

Thankyou for the points:)
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question