Solved

Schedule a daily shutdown on a slackware box

Posted on 2006-06-21
6
480 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
  • 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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

777 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