Solved

Schedule a daily shutdown on a slackware box

Posted on 2006-06-21
6
483 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
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

856 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