Today (Saturday) We will make some minor tuning adjustments to MySQL.

You may experience 2 up to 10 seconds "glitch time" when we restart MySQL. We expect to make these adjustments around 1AM Eastern Daylight Saving Time (EDT) US.


How to accomplished to run zenity in cronjob?


Login or Register to Reply

 
Thread Tools Search this Thread
# 1  
How to accomplished to run zenity in cronjob?

Hi,

I would like to ask some few questions about zenity. I write a script that would generate a report if any changes on the files. i want to used zenity to had a visual alarm report if theres some changes on the comparisons of the file.I used this line of zenity but it doesn't work in cronjob. I terminal windows it works fine(the scripts and the zenity line)

Code:
cat /home/user/tmp/change_report_file | /usr/bin/zenity --text-info --title="Package Change Report" --width=800 --height=300 > /dev/null 2>&1 &

# 2  
How did the 'visual alarm' work? Did it pop up a window? Usually you're not able to do that without an actual login, something cron doesn't give you, but it might be arranged by other means.
This User Gave Thanks to Corona688 For This Post:
# 3  
Hi

Thanks for the speedy response..

@Corona688: by the way it is a laptop machine, i setup the scripts to run during the time i usually used it. What i want is to pop up a window which contain the output of the "cat <dir>/report file"

Attach are the output of the pop up window when i run in terminal.
How to accomplished to run zenity in cronjob?-zenitypng
# 4  
I just offered a solution on another forum not 1.5 hours ago. Smilie
# 6  
@Habitual: Thanks for your reply but i believe you miss understand me about your answer in the other furom.

I found my answer on this link " Running X apps on crontab"

what i did was i add the --display=:0.0 option in the zenity
Code:
cat /home/jao/tmp/zenity | /usr/bin/zenity --text-info --title="Package Change Report" --width=800 --height=300 --display=:0.0

others recommend to add something in the .bashrc since my solution doesn't work to them is enable the scripts to had access to the x session which i didn't try like this one

add this on ~/.bashrc
Code:
[[ $DISPLAY ]] && /usr/bin/xhost +localhost

in the crontab
Code:
* * * * * export DISPLAY='localhost:0.0' bash /script_with_zenity

or in the bashrc edit and replace the following
Code:
  xhost + >& /dev/null (to/with) xhost local:arrange > /dev/null

Thanks for the input everyone..
Login or Register to Reply

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
Function to run a progress bar in zenity
allen11
First off, I'm a novice in bash... I'm trying to make a progress bar in zenity to show progress of a file download. When complete, the progress bar should exit. I'm using a function for the progress bar. Any help appropriated. My code is : #!/bin/bash progress_bar() { ( while : do #...... Shell Programming and Scripting
3
Shell Programming and Scripting
Run cronjob for every 10 minutes
srikanthbiradar
Hi Friends, I have a requirement to run the cronjob for every 10 minutes from 2:00 AM to 6:00 AM. Does the below code works? If not, please advise. * * * * * command to be executed ┬ ┬ ┬ ┬ ┬ │ │ │ │ │ │ │ │ │ │ │ │ │ │ └---------------------------------- day of week (0 - 6) (0 is...... Shell Programming and Scripting
5
Shell Programming and Scripting
My script didn't run every run every minute at cronjob
ngaisteve1
In my cronjob, I would like to schedule my script.sh to run every minutes. I crontab -e and have in line below but it didn't seems to run at all. * * * * * script.sh When I run it manually, I can run it. Is that anything wrong with the above line? If I change it to something like below,...... AIX
4
AIX
Doesn't run as a cronjob...
ruben.rodrigues
Hi! I have a svn backup script that works perfectly if I execute it from the command line but if I set it as a cronjob to run at night, only part of the code works. So, basically the scripts starts by deleting the folder yesterday and then moves the folder today to the folder yesterday. When...... Shell Programming and Scripting
4
Shell Programming and Scripting
cannot run cronjob
shahrahulb
I have the following cron: 0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57 * * * * /v/sysadmin/sysnet/file.pl The .pl has been tried at 755 and 777 The script works if manually run by the web browser or unix command prompt, but I can't get the Cron to do it automatically i went...... UNIX for Advanced & Expert Users
3
UNIX for Advanced & Expert Users

Featured Tech Videos