Automated shtudown


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Automated shtudown
# 1  
Old 05-29-2007
Bug Automated shtudown

Hi all,

I'm using Fedora and I want to be able to set my system up to shut down at a specific time ad hoc. I've been trying to do this using the cron but I can't get the init or shutdown routine to work. Can somebody confirm what the problem is ( I presume this task can be done remotely ).

Thanks.
# 2  
Old 05-29-2007
Are you claiming can't run "shutdown -h now" in a cron job? You would have to be 'root'.
# 3  
Old 05-29-2007
Yep, I haven't done hell of a lot of cron stuff so not very familiar with it, wondering if it's just a syntax problem in the cron or somert but I'm not getting any messages so I can't tell what's wrong
# 4  
Old 05-29-2007
First you want a shell script which wraps up the shutdown...

First

mkdir /root

put the following in /root/shutdown.sh

Code:
#!/bin/sh
echo trying to shutdown at `date`>>/root/shutdown.log
shutdown -h now >>/root/shutdown.log

then chmod +x /root/shutdown.sh

get the current crontab

crontab -l >crontab

edit crontab and add

when-to-do-it-according-to-crontab /root/shutdown.sh

finally

crontab crontab

then check with

crontab -l
# 5  
Old 05-29-2007
Have set everything up.
Get "trying to shutdown at....." in the log file but not a lot else other than that...
# 6  
Old 05-29-2007
Eureka, I've sussed it, needed the full directory path for the shutdown comand.

Thanks for the help Porter.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need an automated script

Hi, I need a script to execute below task. As of now I am doing it manually and want it automated. 1)go to below path cd /path/of/file check for the availibility of two file as below of the latest date. test.week1.data test.week2.data Case1. If above files are not present... (3 Replies)
Discussion started by: sv0081493
3 Replies

2. Shell Programming and Scripting

Automated FTP

Hello,I just know the basics of scripting & I need a script to automate ftp since I use it quite often. I use ftp to transfer different kind of files and everytime the source & the destination directories are different for transferring files, so can anyone help me out on this urgently.. (2 Replies)
Discussion started by: mohit_02mar
2 Replies

3. Shell Programming and Scripting

Automated Login?

hi everyone, btw, this is my first post and I have done extensive searching before posting so here's the problem: I need to be able to do two things from the dll I'm writing. 1.) move a file from our production server to our repository server 2.) verify that the file exists in the... (7 Replies)
Discussion started by: jshapaka
7 Replies

4. Shell Programming and Scripting

Automated FTP

I want to do Automated FTP from linux client to LINUX server using a shell script after every one hour. And copies last most updated file from Linux server. OR You can say that whenever files get modified on LINUX server so it also copies on my LINUX client. Linux SERVER path=... (4 Replies)
Discussion started by: wakhan
4 Replies

5. Shell Programming and Scripting

i want automated script

echo "Enter your choice :\c" read num case $num in . 1)"${TEST_HOME}"/ctrl_extract.ksh 1 ;; 2)"${TEST_HOME}"/ctrl_extract.ksh 2 ;;3)"${TEST_HOME}"/ctrl_extract.ksh 3 ;; 4)"${TEST_HOME}"/ctrl_extract.ksh 4 ;; 5)"${TEST_HOME}"/ctrl_extract.ksh 5 ;;... (3 Replies)
Discussion started by: arghya_owen
3 Replies

6. Shell Programming and Scripting

automated ftp.

Hi I am trying to delete some specific files ( files other than created today) from the server on a cron basis. I wrote a small script, but I am stuck up in how to delete only specific files. #!/usr/bin/expect -f set IP set timeout -1 spawn ftp $IP expect ): send "username\n"... (10 Replies)
Discussion started by: sangfroid
10 Replies

7. UNIX for Advanced & Expert Users

help for automated script

Hi ALL: I need to write a script that will start bunch of servers. and these servers each has a sudo account and they need a passowrd. I dont know where to start and look. Can you please give me some hints or some sample code. Thanks in advance. splax (4 Replies)
Discussion started by: splax
4 Replies

8. Shell Programming and Scripting

automated plotting

Hi, I would like to make a lot of plots with for instance xmgrace and don't know how. I have a directory with about 500 data files with the same structure and I want to plot always the same columns. I don't know how to call xmgrace to produce a, say, gif plot of the columns 3 and 4 of... (2 Replies)
Discussion started by: pau
2 Replies

9. UNIX for Advanced & Expert Users

Automated FTP

My requiremnet is to write a FTP script which will ftp a file to a specified ftp url. How can I automate the process usnig the unix cron. (11 Replies)
Discussion started by: shauche
11 Replies
Login or Register to Ask a Question