You are not logged in.

#1 2010-01-02 08:02:24

sHyLoCk
Member
From: /dev/null
Registered: 2009-06-19
Posts: 1,197

Display error dialog [SOLVED]

Hi, I have a very simple rsync script which root runs everyday at 8AM. I use that script to backup in my external HDD. Right now the script is as such that it will write an error log in my /home directory if the media is not plugged. I want to display a warning message in a popup window, maybe in gtk, asking the user to plugin the HDD just 5 minutes before the backup begins. I've no idea how to do this. Here is my backup script:

#!/bin/bash
check="/media/backup"
if [ -d $check ]; then
rsync --verbose  --progress --stats --compress \
      --recursive --times --delete-excluded --links --delete \
      --exclude-from=/home/pdg/.rsync/exclude \
      / /media/backup/arch-backup/
echo "Rsync Backup Completed!" >> /home/pdg/backup.log
echo "EXITING" >> /home/pdg/backup.log
echo `date` >> /home/pdg/backup.log
exit 0
else
echo "Plugin and Mount your USB backup drive!" >> /home/pdg/error.log 
echo "EXITING" >> /home/pdg/error.log
echo `date` >> /home/pdg/error.log
exit 1
fi

I want the message box/dialog to appear just 5minutes before 8AM. So, I'll add it to cron, but I'd appreciate any help regarding how to proceed on making such a dialog box which the cron can trigger.

Regards

Last edited by sHyLoCk (2010-01-02 08:17:25)


~ Regards,
sHy
ArchBang: Yet another Distro for Allan to break.
Blog | GIT | Forum (。◕‿◕。)

Offline

#2 2010-01-02 08:09:36

JohannesSM64
Member
From: Norway
Registered: 2009-10-11
Posts: 623
Website

Re: Display error dialog [SOLVED]

zenity.

Offline

#3 2010-01-02 08:16:22

sHyLoCk
Member
From: /dev/null
Registered: 2009-06-19
Posts: 1,197

Re: Display error dialog [SOLVED]

Thanks I'll check it out. I was browsing through the gtk documentation trying to figure this out. Crazy tongue

zenity --info --text=Please\ Plugin\ your\ /media/backup\ Drive,\ Backup\ starts\ in\ 5\ minutes!

Last edited by sHyLoCk (2010-01-02 08:21:55)


~ Regards,
sHy
ArchBang: Yet another Distro for Allan to break.
Blog | GIT | Forum (。◕‿◕。)

Offline

Board footer

Powered by FluxBB