LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 01-16-2005, 04:13 AM   #1
Klas
Member
 
Registered: Oct 2003
Location: Uppsala, Sweden
Distribution: Mandrake 9.1, Mandrake 10.0
Posts: 77

Rep: Reputation: 15
Cron and GUI apps


Hi
I have made a small antivirus script that i plan use as a cron.weekly job. What the script does is to pop up a dialog that will warn me that a scan is about to take place, and that it will affect my pc for a while.

Code:
#!/bin/sh
#Show a dialog box
/usr/bin/kdialog --title "Antivirus scan at: `/bin/date`" --msgbox "Antivirus scan will start in 10 seconds. It will affect the pc for the next 20 minuts or so."&
#Sleep for 10 seconds
/bin/sleep 10
#Update signatures
/usr/local/f-prot/tools/check-updates.pl
#Perform scan and send output to Klas mail
/bin/nice --adjustment=+19 /usr/local/bin/f-prot /home/klas/ /etc/ /bin/ /boot/ /lib/ /sbin/ /tmp/ /usr/ /var/ | mail -s "Virus scanning report" mail adress
The script workes fine when i manually run it as regulary user or as root.

The scanning part of the script also works fine when "cron" runs it, BUT the dialog wont pop up.

Why wont the dialog pop up? I am guessing that the "cron" shell dont have the same "settings" as my normal shells? How can i fix that?

Kind regards
Klas
 
Old 01-16-2005, 10:28 AM   #2
LasseW
Member
 
Registered: Oct 2004
Distribution: Fedora 7, OpenSuse 10.2
Posts: 108

Rep: Reputation: 15
Check the value of DISPLAY in your shell, then add that to the script, for instance

export DISPLAY=:0.0
 
Old 01-16-2005, 01:26 PM   #3
Klas
Member
 
Registered: Oct 2003
Location: Uppsala, Sweden
Distribution: Mandrake 9.1, Mandrake 10.0
Posts: 77

Original Poster
Rep: Reputation: 15
Thumbs up

Thanks!
It seems to work, now ill just wait for the next cron to run
 
  


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
X apps fail when run from cron jobs ericcarlson Linux - Software 6 06-16-2017 01:02 PM
Linux GUI Apps markjuggles Programming 5 02-25-2005 10:06 PM
I'm looking for some GUI apps.. VertX Linux - Newbie 3 02-08-2005 03:06 PM
Is there a cron gui for fc2? albean Linux - Newbie 2 01-30-2005 06:24 PM
GUI for cron in Red Hat 8? naijaguy Red Hat 2 08-17-2004 02:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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