LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 06-15-2006, 10:59 PM   #1
roclok
LQ Newbie
 
Registered: Jun 2006
Posts: 16

Rep: Reputation: 0
Crontab Not working appropriate?


I created two scripts. One for opening an image with kuickshow, the other for powering off computer.


my_picture script contains:
Code:
#!/bin/bash
# Warning to Shutdown

kuickshow '/home/bdd86/Documents/goodnight.gif'
my_poweroff script contains:
Code:
#!/bin/bash
# Poweroff now

poweroff

Crontab -e
Code:
53 22 * * * '/home/bdd86/Documents/my_picture'
54 22 * * * '/home/bdd86/Documents/my_poweroff'
Nothing happens at 10:53.... my_picture does not run... but a minute later my_poweroff runs perfect.

When I run ./my_picture in konsole it opens fine. but Crontab just doesnt seem to run it at all?

How can I get crontab to open a picture in kuickshow?

THank you!
 
Old 06-15-2006, 11:06 PM   #2
kaz2100
Senior Member
 
Registered: Apr 2005
Location: Penguin land, with apple, no gates
Distribution: Debian testing woody(32) sarge etch lenny squeeze(+64) wheezy jessie
Posts: 1,455

Rep: Reputation: 84
permission??
 
Old 06-15-2006, 11:13 PM   #3
roclok
LQ Newbie
 
Registered: Jun 2006
Posts: 16

Original Poster
Rep: Reputation: 0
No I ran chmod 755 my_script and when i do ./my_script it works perfect... Crontab just wont run it???????
 
Old 06-15-2006, 11:15 PM   #4
kencaz
Senior Member
 
Registered: Mar 2005
Location: Las Vegas, NV
Distribution: Mandriva Slackware FreeBSD
Posts: 1,468

Rep: Reputation: 48
kuickshow is an X application which crontab cannot handle.

KC
 
Old 06-15-2006, 11:19 PM   #5
roclok
LQ Newbie
 
Registered: Jun 2006
Posts: 16

Original Poster
Rep: Reputation: 0
Ok, how can I make a script Open up a Konsole, with pre-written text in it, saying You have 30 Minutes until computer power off?
 
Old 06-15-2006, 11:36 PM   #6
kencaz
Senior Member
 
Registered: Mar 2005
Location: Las Vegas, NV
Distribution: Mandriva Slackware FreeBSD
Posts: 1,468

Rep: Reputation: 48
try adding DISPLAY=:0 to the begining of your crontab file...

KC
 
Old 06-16-2006, 12:01 AM   #7
roclok
LQ Newbie
 
Registered: Jun 2006
Posts: 16

Original Poster
Rep: Reputation: 0
No this didn't work, heres my crontab file

Code:
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.6299 installed on Fri Jun 16 00:00:21 2006)
# (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $)
DISPLAY=:0
01 01  * * * '/home/bdd86/Documents/my_script'
50 23 * * * '/home/bdd86/Documents/my_poweroff'
 
Old 06-16-2006, 12:25 AM   #8
kencaz
Senior Member
 
Registered: Mar 2005
Location: Las Vegas, NV
Distribution: Mandriva Slackware FreeBSD
Posts: 1,468

Rep: Reputation: 48
Try adding the line directly to crontab using "crontab -e". A script is not required in most cases.

DISPLAY=:0
00 21 * * Mon-Fri kuickshow /home/bdd86/Documents/goodnight.gif

This works fine for me... Test it and see...

KC
 
Old 06-16-2006, 12:31 AM   #9
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 56
Have you considered the shutdown command? It can be scheduled and gives a warning to logged in users one minute in advance.
Needs to be run by the root user...
For example:
Code:
sudo shutdown 00:35

or

su - -c "shutdown 00:35"
More options from man shutdown
 
Old 06-16-2006, 12:34 AM   #10
roclok
LQ Newbie
 
Registered: Jun 2006
Posts: 16

Original Poster
Rep: Reputation: 0
Kencaz, for some reason, that worked PErfectly that time. I think i was using "'"s in the wrong place. THanks alot, My Notice system for my g/f's sister to get off my computer Is Working, and poweroff works perfectly 1 minutes later. Thanks dude !!!!!!!!!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
crontab not working durgap Linux - General 6 09-01-2005 03:38 PM
crontab nor working navaladi Mandriva 11 01-17-2005 07:58 AM
crontab not working subaruwrx Linux - Newbie 8 08-17-2004 10:12 PM
Unable to get crontab working carlmarshall Linux - Newbie 9 06-10-2004 04:37 PM
Crontab not working Neorio *BSD 1 12-02-2003 08:34 PM


All times are GMT -5. The time now is 04:47 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration