LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-15-2011, 06:58 AM   #1
sanjay87
Member
 
Registered: Oct 2011
Posts: 164

Rep: Reputation: Disabled
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

Last edited by sanjay87; 11-15-2011 at 07:05 AM.
 
Old 11-15-2011, 07:22 AM   #2
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,475

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
try
Code:
shutdown -r now
 
Old 11-15-2011, 07:47 AM   #3
fukawi1
Member
 
Registered: Apr 2009
Location: Melbourne
Distribution: Fedora & CentOS
Posts: 854

Rep: Reputation: 193Reputation: 193
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...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How to run a program for a specific amount of time starting at a specific time? thiemster Linux - Newbie 12 05-18-2010 09:04 AM
Command or grep to know system reboot time rockcharles1 Linux - General 2 10-05-2007 03:49 PM
Why does my system reboot every time i try.... Hdstdlxe Linux - Newbie 9 10-22-2005 04:31 AM
Only starting command in a specific time period jeroenvrp Linux - Software 3 07-20-2004 11:18 PM
Giving Specific users access to the reboot command shassouneh Linux - Security 15 03-24-2004 05:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:20 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration