Solved

Schedule a daily shutdown on a slackware box

Posted on 2006-06-21
6
478 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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

705 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now