LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 12-18-2013, 02:59 AM   #1
glennbtn
Member
 
Registered: Dec 2009
Posts: 154

Rep: Reputation: 19
Shutdown script issue


Hi All

I have a server running Ubuntu 12.04 that we only need during the day so I setup a script to shutdown the server at 11pm each night to save power. I did this years ago on a centos box but can't get it to work.

The logs show the script is run when I tail them and the email to root says shutdown -h now: not found

I have tried different commands and put them in "" just in case as well, but nothing seems to work. I chmod the file to 755 like the rest of my scripts and if I run the script manually it works but not when scheduled

Anyone got any ideas please

thanks

Glenn
 
Old 12-18-2013, 03:07 AM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Difficult to tell without looking at the script. Anyway, the error message means it is looking for a command named "shutdown -h now", whereas it should be "shutdown" only. Maybe a misuse of the double quotes?
 
Old 12-20-2013, 04:39 AM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
How do you schedule it; in cron?
Try giving the full path
Code:
/sbin/shutdown -h now
 
  


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
Start-Up Script & Shutdown/Kill Script needed guggilamsandeep Red Hat 1 05-11-2011 08:58 AM
Shutdown Issue midnytblu Linux - Newbie 7 08-01-2008 01:09 AM
shutdown issue using centos 5.0 alex.archip Linux - Laptop and Netbook 4 09-09-2007 01:01 AM
suse shutdown issue robkovacs Linux - Hardware 1 04-22-2005 11:09 AM
Shutdown issue under X FlodderMouse Linux - General 7 12-20-2001 10:45 PM

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

All times are GMT -5. The time now is 04:57 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