• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Resolved How to Automatically Shut Down Servers at Defined Times?

iGraphics

Basic Pleskian
Hello Everyone,

How to Automatically Shut Down Servers at Defined Times?
I want to Shut Down my server on 25/Dec/2017 at 03:00 PM

Can I make that by Scheduled Tasks in Plesk control panel ?
or By SSH ?

Please if by SSH give me the command line for shutting down on 25/Dec/2017 at 03:00 PM

OS ‪CentOS Linux 7.4.1708 (Core)‬
Product Plesk Onyx
Version 17.5.3 Update #35, last updated on Dec 20, 2017 03:31 AM



Thanks
 
Hello Everyone,

How to Automatically Shut Down Servers at Defined Times?
I want to Shut Down my server on 25/Dec/2017 at 03:00 PM

Can I make that by Scheduled Tasks in Plesk control panel ?
or By SSH ?

Please if by SSH give me the command line for shutting down on 25/Dec/2017 at 03:00 PM

OS ‪CentOS Linux 7.4.1708 (Core)‬
Product Plesk Onyx
Version 17.5.3 Update #35, last updated on Dec 20, 2017 03:31 AM



Thanks

Hello,
the easiest will be to add a cronjob with the command crontab -e , and to add the following line :
Code:
0 3 25 * * /sbin/shutdown now
 
Hi,

One of the ways:

Use command `at` and `atd` daemon:
1. Install at
# yum install -y at

2. Start atd
# service atd start

3. Plan to do something:
# echo "touch /tmp/1.txt" | at 1629 Dec 20
job 1 at Wed Dec 20 16:29:00 2017


4. Check:
# date
Wed Dec 20 16:29:09 NOVT 2017
# ls -la /tmp/1.txt
-rw-r--r-- 1 root root 0 Dec 20 16:29 /tmp/1.txt


So, if it works for you, you can use any other date and any other command. If you execute this command as user, use `sudo`.
 
Thanks for reply, What about this command line:
Code:
screen -d -m shutdown -h +$((($(date +%s -d "12/25 15:00 2017") - $(date +%s)) / 60))
 
Back
Top