LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   command to reboot system at specific time (https://www.linuxquestions.org/questions/linux-server-73/command-to-reboot-system-at-specific-time-913636/)

sanjay87 11-15-2011 06:58 AM

command to reboot system at specific time
 
HI
Im making out shell scripts to reboot my server every day and moving logs backup using remote drive .can someone tell me what command let me use to reboot my system on specific time.my system is not reboot as first ..my following shell scripts is not working off...




#!/bin/bash
date=`/bin/date "+%Y.%m.%d.%H.%M.%S"`
tar -xvf /bkup/$date.tar /opt/apps/tomcat/apache-tomcat-6.0.26/logs/
mail -s $date xx@gmail.com <<EOF
Backup Completed Successfully
reboot

TenTenths 11-15-2011 07:22 AM

try
Code:

shutdown -r now

fukawi1 11-15-2011 07:47 AM

Read up on "cron" to schedule tasks.
While your at it, read up on tar.
tar -xvf will verbosely extract files from /bkup/$date.tar. It doesn't sound like this is what you want to do.

Why on earth would you want to reboot a Linux web server every day? How very windows of you...


All times are GMT -5. The time now is 04:15 AM.