You are not logged in.
Pages: 1
Hi guys,
I have a little problem that is possible someone knows the answer to ![]()
I used to back up my system with a GUI program, but lately it began to give me grief so I decided to go the "old Unix way" and started using rsync.
The program works well (and FAST!!) and I'm most happy with the results but this is my problem:
I like to have a popup tell me that the backups are running. I have used in the past, with success I may add, kdialog to do just that.
Now with my new script and rsync it's not working. ![]()
To be clear... the backups happen on time and as they should but I get no message from kdialog to let me know.
The back up script runs from crontab.
Here is the script:
#!/bin/bash
SOURCE=$HOME/HTML
TARGET=$HOME/.net-backup/spitfire
LOGS=$HOME/bin/backup.d/Logs
EXCLUDE=$HOME/bin/backup.d
# backup report
function show_report {
/usr/bin/kdialog --title "Backup Notification" --passivepopup "Running 2 hours backup" 10
}
# show on screen
show_report
rsync -azv --delete --exclude-from $EXCLUDE/'exclude.txt' $SOURCE/ceb/ $TARGET/EOHour/ceb/ > $LOGS/ceb.log
rsync -azv --delete --exclude-from $EXCLUDE/'exclude.txt' $SOURCE/SMART2012/ $TARGET/EOHour/SMART2012/ > $LOGS/smart2012.logHere is the crontab line that runs it:
0 */2 * * * /home/ralvez/bin/backup.d/2hoursAm I missing something?
Thanks for any advice.
Ricardo
edit: If I run the script "by hand" not with crontab I get the kdialog message
Last edited by ralvez (2012-03-11 02:23:20)
Offline
Have you looked in the logs?
Do you run is as root or are you using your user's crontab? Running X apps as root is bad & tricky https://wiki.archlinux.org/index.php/Ru … ps_as_root
https://bbs.archlinux.org/viewtopic.php … 9#p1035169
Please use [ code ] tags for posting snippets of code.
like thisLast edited by karol (2012-03-10 19:58:12)
Offline
I'm using it as a user.
I did look at /var/log/everything.log and /var/log/error.log but cannot find anything useful ![]()
BTW I did use code tags but the wrong way: "<code>" as opposed to "["code"]" ![]()
I'll take a look at those links.
R.
Offline
I've not tried to run something in X from a cron job, but you could try specifying the display for kdialogue to run on.
# edit: this works for me with notify-send
DISPLAY=:0.0 /usr/bin/notify-send Cronjob "Success!"Last edited by jasonwryan (2012-03-10 20:48:28)
Offline
@jasonwryan,
You are the man!!
Yes... adding the "DISPLAY=:0.0" did it!!
Thank you all for the help.
R.
Offline
Pages: 1