Gentoo Archives: gentoo-user

From: reader@×××××××.com
To: gentoo-user@l.g.o
Subject: [gentoo-user] How to tell Cron X is running or not
Date: Mon, 26 Nov 2007 01:33:31
1 Scripts that test for X running might work in a shell but not when the
2 script is run by cron.
4 For example: This code:
5 tty|grep pts
6 retval=$?
7 if [[ $retval > 0 ]];then
8 print "X isn't running just now... postponing rsync of WWW
9 until such time as it is... exiting"
10 exit
11 fi
13 Runs fine when run from a user shell, but when cron runs it the test
14 always fails to be true.
16 So how can I test for X running in case where script will be run by cron?
18 --
19 gentoo-user@g.o mailing list


Subject Author
Re: [gentoo-user] How to tell Cron X is running or not Andrey Falko <ma3oxuct@×××××.com>