LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 11-16-2005, 12:52 AM   #1
akudewan
Member
 
Registered: Apr 2004
Location: India
Distribution: Ubuntu
Posts: 364

Rep: Reputation: 31
scheduling poweroff using cron


Hi,

I usually download stuff at night, as my ISP starts charging me only from 8:00AM. I wanted to schedule a poweroff before 8:00AM. I did a little google-ing and modified my /etc/crontab.

I just want to know if my entries are correct. Here is the file:

Code:
# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file.
# This file also has a username field, that none of the other crontabs do.

SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

# m h dom mon dow user	command
17 *	* * *	root    run-parts --report /etc/cron.hourly
25 6	* * *	root	test -x /usr/sbin/anacron || run-parts --report /etc/cron.daily
47 6	* * 7	root	test -x /usr/sbin/anacron || run-parts --report /etc/cron.weekly
52 6	1 * *	root	test -x /usr/sbin/anacron || run-parts --report /etc/cron.monthly
# Shut down Azureus
46 7 * * * root killall -15 java
# Kill wine
45 7 * * * root killall -9 wine-preloader
# Power off
49 7 * * * root poweroff
#
Thanks,
-Aku
 
Old 11-16-2005, 03:53 AM   #2
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 57
I guess killall -15 is blocked by wine-preloader it's why you send a killall -9. Kill -9 kills the program without any mean for him to save anything, so it is more dangerous..

Yes your cron are correct
 
Old 11-17-2005, 04:00 AM   #3
akudewan
Member
 
Registered: Apr 2004
Location: India
Distribution: Ubuntu
Posts: 364

Original Poster
Rep: Reputation: 31
Thanks, it worked perfectly today morning I was using signal -9 for wine because it doesn't exit properly, and sometimes causes the disk to not unmount properly while powering off.
 
  


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
shell script using /etc/cron.hourly to execute cron.php file? rioguia Programming 3 06-11-2008 08:09 AM
cron scheduling and time change dsschanze Linux - General 3 11-13-2005 04:22 PM
scheduling monthly job in cron from debian sarge 3.1 sridhar11 Debian 2 10-28-2005 09:03 AM
PPPD Script problem when cron-scheduling the script andresurzagasti Linux - Networking 0 11-24-2004 02:54 PM
Problems scheduling jobs with cron ferrantepunto Linux - General 5 01-24-2003 07:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

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