How to use notify-send with crontab? [duplicate]
This question already has an answer here:
Notify-send doesn't work from crontab
13 answers
I really read many tutorials, but crontab doesn't start notify send.
What I've tried:
etc/crontab
added at the end:
15 * * * * notify-send 'crontab' 'test'
with crontab interface:
crontab -e
added at the end:
15 * * * * notify-send 'crontab' 'test'
cron
marked as duplicate by Jacob Vlijm, Eric Carvalho, Rinzwind, Byte Commander, Aaron Oct 8 '16 at 19:32
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
This question already has an answer here:
Notify-send doesn't work from crontab
13 answers
I really read many tutorials, but crontab doesn't start notify send.
What I've tried:
etc/crontab
added at the end:
15 * * * * notify-send 'crontab' 'test'
with crontab interface:
crontab -e
added at the end:
15 * * * * notify-send 'crontab' 'test'
cron
marked as duplicate by Jacob Vlijm, Eric Carvalho, Rinzwind, Byte Commander, Aaron Oct 8 '16 at 19:32
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
3
Try to run .sh script by editingeval "export $(egrep -z DBUS_SESSION_BUS_ADDRESS /proc/$(pgrep -u $LOGNAME gnome-session)/environ)";
– d a i s y
Oct 8 '16 at 7:23
@Lnux , Where do I place this line? On .sh file before thenotify-send 'crontab' 'test'
?
– Vitor Abella
Oct 8 '16 at 7:44
yes in your bash script before notify-send
– d a i s y
Oct 8 '16 at 7:51
on16.04
this one worked*/1 * * * * eval "export $(egrep -z DBUS_SESSION_BUS_ADDRESS /proc/$(pgrep -u $LOGNAME gnome-session)/environ)";/usr/bin/notify-send -i appointment -c "im" "Keep Working"
– KrIsHnA
Jul 8 '18 at 5:56
* * * * * export $(egrep -z DBUS_SESSION_BUS_ADDRESS /proc/$(pgrep -u $LOGNAME gnome-session)/environ) && DISPLAY=:0 notify-send "Foo bar"
– Saeed Falsafin
Dec 21 '18 at 15:03
add a comment |
This question already has an answer here:
Notify-send doesn't work from crontab
13 answers
I really read many tutorials, but crontab doesn't start notify send.
What I've tried:
etc/crontab
added at the end:
15 * * * * notify-send 'crontab' 'test'
with crontab interface:
crontab -e
added at the end:
15 * * * * notify-send 'crontab' 'test'
cron
This question already has an answer here:
Notify-send doesn't work from crontab
13 answers
I really read many tutorials, but crontab doesn't start notify send.
What I've tried:
etc/crontab
added at the end:
15 * * * * notify-send 'crontab' 'test'
with crontab interface:
crontab -e
added at the end:
15 * * * * notify-send 'crontab' 'test'
This question already has an answer here:
Notify-send doesn't work from crontab
13 answers
cron
cron
edited Oct 8 '16 at 9:30
Jacob Vlijm
63.5k9123218
63.5k9123218
asked Oct 8 '16 at 6:21
Vitor Abella
2,709102762
2,709102762
marked as duplicate by Jacob Vlijm, Eric Carvalho, Rinzwind, Byte Commander, Aaron Oct 8 '16 at 19:32
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
marked as duplicate by Jacob Vlijm, Eric Carvalho, Rinzwind, Byte Commander, Aaron Oct 8 '16 at 19:32
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
3
Try to run .sh script by editingeval "export $(egrep -z DBUS_SESSION_BUS_ADDRESS /proc/$(pgrep -u $LOGNAME gnome-session)/environ)";
– d a i s y
Oct 8 '16 at 7:23
@Lnux , Where do I place this line? On .sh file before thenotify-send 'crontab' 'test'
?
– Vitor Abella
Oct 8 '16 at 7:44
yes in your bash script before notify-send
– d a i s y
Oct 8 '16 at 7:51
on16.04
this one worked*/1 * * * * eval "export $(egrep -z DBUS_SESSION_BUS_ADDRESS /proc/$(pgrep -u $LOGNAME gnome-session)/environ)";/usr/bin/notify-send -i appointment -c "im" "Keep Working"
– KrIsHnA
Jul 8 '18 at 5:56
* * * * * export $(egrep -z DBUS_SESSION_BUS_ADDRESS /proc/$(pgrep -u $LOGNAME gnome-session)/environ) && DISPLAY=:0 notify-send "Foo bar"
– Saeed Falsafin
Dec 21 '18 at 15:03
add a comment |
3
Try to run .sh script by editingeval "export $(egrep -z DBUS_SESSION_BUS_ADDRESS /proc/$(pgrep -u $LOGNAME gnome-session)/environ)";
– d a i s y
Oct 8 '16 at 7:23
@Lnux , Where do I place this line? On .sh file before thenotify-send 'crontab' 'test'
?
– Vitor Abella
Oct 8 '16 at 7:44
yes in your bash script before notify-send
– d a i s y
Oct 8 '16 at 7:51
on16.04
this one worked*/1 * * * * eval "export $(egrep -z DBUS_SESSION_BUS_ADDRESS /proc/$(pgrep -u $LOGNAME gnome-session)/environ)";/usr/bin/notify-send -i appointment -c "im" "Keep Working"
– KrIsHnA
Jul 8 '18 at 5:56
* * * * * export $(egrep -z DBUS_SESSION_BUS_ADDRESS /proc/$(pgrep -u $LOGNAME gnome-session)/environ) && DISPLAY=:0 notify-send "Foo bar"
– Saeed Falsafin
Dec 21 '18 at 15:03
3
3
Try to run .sh script by editing
eval "export $(egrep -z DBUS_SESSION_BUS_ADDRESS /proc/$(pgrep -u $LOGNAME gnome-session)/environ)";
– d a i s y
Oct 8 '16 at 7:23
Try to run .sh script by editing
eval "export $(egrep -z DBUS_SESSION_BUS_ADDRESS /proc/$(pgrep -u $LOGNAME gnome-session)/environ)";
– d a i s y
Oct 8 '16 at 7:23
@Lnux , Where do I place this line? On .sh file before the
notify-send 'crontab' 'test'
?– Vitor Abella
Oct 8 '16 at 7:44
@Lnux , Where do I place this line? On .sh file before the
notify-send 'crontab' 'test'
?– Vitor Abella
Oct 8 '16 at 7:44
yes in your bash script before notify-send
– d a i s y
Oct 8 '16 at 7:51
yes in your bash script before notify-send
– d a i s y
Oct 8 '16 at 7:51
on
16.04
this one worked */1 * * * * eval "export $(egrep -z DBUS_SESSION_BUS_ADDRESS /proc/$(pgrep -u $LOGNAME gnome-session)/environ)";/usr/bin/notify-send -i appointment -c "im" "Keep Working"
– KrIsHnA
Jul 8 '18 at 5:56
on
16.04
this one worked */1 * * * * eval "export $(egrep -z DBUS_SESSION_BUS_ADDRESS /proc/$(pgrep -u $LOGNAME gnome-session)/environ)";/usr/bin/notify-send -i appointment -c "im" "Keep Working"
– KrIsHnA
Jul 8 '18 at 5:56
* * * * * export $(egrep -z DBUS_SESSION_BUS_ADDRESS /proc/$(pgrep -u $LOGNAME gnome-session)/environ) && DISPLAY=:0 notify-send "Foo bar"
– Saeed Falsafin
Dec 21 '18 at 15:03
* * * * * export $(egrep -z DBUS_SESSION_BUS_ADDRESS /proc/$(pgrep -u $LOGNAME gnome-session)/environ) && DISPLAY=:0 notify-send "Foo bar"
– Saeed Falsafin
Dec 21 '18 at 15:03
add a comment |
2 Answers
2
active
oldest
votes
As suggested by @Lnux:
Create a .sh, for example test.sh
:
#!/bin/sh
eval "export $(egrep -z DBUS_SESSION_BUS_ADDRESS /proc/$(pgrep -u $LOGNAME gnome-session)/environ)";
#Code:
DISPLAY=:0 notify-send "Test"
Then set up crontab:
crontab -e
And at the bottom, add:
* * * * * /home/myUser/test.sh
Obs.: you can place your .sh file in another location and don't forget to allow executing it.
In case it helps anyone else, I was able to replace the providedeval ...
with:eval "export | egrep 'DBUS_SESSION_BUS_ADDRESS|DISPLAY'"
.
– pdoherty926
Nov 9 '17 at 15:10
add a comment |
Crontab is running in the background and without specified graphical output it will show nothing. So you should spicify, which output would you like to use. To achieve that, put export DISPLAY=:0 &&
before you command, e.g.
15 * * * * export DISPLAY=:0 && notify-send 'I am alive!'
'DISPLAY=:' or 'DISPLAY='
– Vitor Abella
Oct 8 '16 at 7:02
DISPLAY=:0 , the colon is neccessary.
– Michal Polovka
Oct 8 '16 at 7:08
I copied and pasted your code using ` crontab -e` using user and root and nothing happens...
– Vitor Abella
Oct 8 '16 at 7:14
well that is unexpected, because I did the same (except I changed 15 minutes to *) and it works. Try to change the DISPLAY variable to 1 or 2, I have seen it help sometimes, although I don't fully understand why.
– Michal Polovka
Oct 8 '16 at 7:20
Do you have to reboot to start?
– Vitor Abella
Oct 8 '16 at 7:25
|
show 3 more comments
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
As suggested by @Lnux:
Create a .sh, for example test.sh
:
#!/bin/sh
eval "export $(egrep -z DBUS_SESSION_BUS_ADDRESS /proc/$(pgrep -u $LOGNAME gnome-session)/environ)";
#Code:
DISPLAY=:0 notify-send "Test"
Then set up crontab:
crontab -e
And at the bottom, add:
* * * * * /home/myUser/test.sh
Obs.: you can place your .sh file in another location and don't forget to allow executing it.
In case it helps anyone else, I was able to replace the providedeval ...
with:eval "export | egrep 'DBUS_SESSION_BUS_ADDRESS|DISPLAY'"
.
– pdoherty926
Nov 9 '17 at 15:10
add a comment |
As suggested by @Lnux:
Create a .sh, for example test.sh
:
#!/bin/sh
eval "export $(egrep -z DBUS_SESSION_BUS_ADDRESS /proc/$(pgrep -u $LOGNAME gnome-session)/environ)";
#Code:
DISPLAY=:0 notify-send "Test"
Then set up crontab:
crontab -e
And at the bottom, add:
* * * * * /home/myUser/test.sh
Obs.: you can place your .sh file in another location and don't forget to allow executing it.
In case it helps anyone else, I was able to replace the providedeval ...
with:eval "export | egrep 'DBUS_SESSION_BUS_ADDRESS|DISPLAY'"
.
– pdoherty926
Nov 9 '17 at 15:10
add a comment |
As suggested by @Lnux:
Create a .sh, for example test.sh
:
#!/bin/sh
eval "export $(egrep -z DBUS_SESSION_BUS_ADDRESS /proc/$(pgrep -u $LOGNAME gnome-session)/environ)";
#Code:
DISPLAY=:0 notify-send "Test"
Then set up crontab:
crontab -e
And at the bottom, add:
* * * * * /home/myUser/test.sh
Obs.: you can place your .sh file in another location and don't forget to allow executing it.
As suggested by @Lnux:
Create a .sh, for example test.sh
:
#!/bin/sh
eval "export $(egrep -z DBUS_SESSION_BUS_ADDRESS /proc/$(pgrep -u $LOGNAME gnome-session)/environ)";
#Code:
DISPLAY=:0 notify-send "Test"
Then set up crontab:
crontab -e
And at the bottom, add:
* * * * * /home/myUser/test.sh
Obs.: you can place your .sh file in another location and don't forget to allow executing it.
answered Oct 8 '16 at 8:11
Vitor Abella
2,709102762
2,709102762
In case it helps anyone else, I was able to replace the providedeval ...
with:eval "export | egrep 'DBUS_SESSION_BUS_ADDRESS|DISPLAY'"
.
– pdoherty926
Nov 9 '17 at 15:10
add a comment |
In case it helps anyone else, I was able to replace the providedeval ...
with:eval "export | egrep 'DBUS_SESSION_BUS_ADDRESS|DISPLAY'"
.
– pdoherty926
Nov 9 '17 at 15:10
In case it helps anyone else, I was able to replace the provided
eval ...
with: eval "export | egrep 'DBUS_SESSION_BUS_ADDRESS|DISPLAY'"
.– pdoherty926
Nov 9 '17 at 15:10
In case it helps anyone else, I was able to replace the provided
eval ...
with: eval "export | egrep 'DBUS_SESSION_BUS_ADDRESS|DISPLAY'"
.– pdoherty926
Nov 9 '17 at 15:10
add a comment |
Crontab is running in the background and without specified graphical output it will show nothing. So you should spicify, which output would you like to use. To achieve that, put export DISPLAY=:0 &&
before you command, e.g.
15 * * * * export DISPLAY=:0 && notify-send 'I am alive!'
'DISPLAY=:' or 'DISPLAY='
– Vitor Abella
Oct 8 '16 at 7:02
DISPLAY=:0 , the colon is neccessary.
– Michal Polovka
Oct 8 '16 at 7:08
I copied and pasted your code using ` crontab -e` using user and root and nothing happens...
– Vitor Abella
Oct 8 '16 at 7:14
well that is unexpected, because I did the same (except I changed 15 minutes to *) and it works. Try to change the DISPLAY variable to 1 or 2, I have seen it help sometimes, although I don't fully understand why.
– Michal Polovka
Oct 8 '16 at 7:20
Do you have to reboot to start?
– Vitor Abella
Oct 8 '16 at 7:25
|
show 3 more comments
Crontab is running in the background and without specified graphical output it will show nothing. So you should spicify, which output would you like to use. To achieve that, put export DISPLAY=:0 &&
before you command, e.g.
15 * * * * export DISPLAY=:0 && notify-send 'I am alive!'
'DISPLAY=:' or 'DISPLAY='
– Vitor Abella
Oct 8 '16 at 7:02
DISPLAY=:0 , the colon is neccessary.
– Michal Polovka
Oct 8 '16 at 7:08
I copied and pasted your code using ` crontab -e` using user and root and nothing happens...
– Vitor Abella
Oct 8 '16 at 7:14
well that is unexpected, because I did the same (except I changed 15 minutes to *) and it works. Try to change the DISPLAY variable to 1 or 2, I have seen it help sometimes, although I don't fully understand why.
– Michal Polovka
Oct 8 '16 at 7:20
Do you have to reboot to start?
– Vitor Abella
Oct 8 '16 at 7:25
|
show 3 more comments
Crontab is running in the background and without specified graphical output it will show nothing. So you should spicify, which output would you like to use. To achieve that, put export DISPLAY=:0 &&
before you command, e.g.
15 * * * * export DISPLAY=:0 && notify-send 'I am alive!'
Crontab is running in the background and without specified graphical output it will show nothing. So you should spicify, which output would you like to use. To achieve that, put export DISPLAY=:0 &&
before you command, e.g.
15 * * * * export DISPLAY=:0 && notify-send 'I am alive!'
answered Oct 8 '16 at 6:53
Michal Polovka
1,1551819
1,1551819
'DISPLAY=:' or 'DISPLAY='
– Vitor Abella
Oct 8 '16 at 7:02
DISPLAY=:0 , the colon is neccessary.
– Michal Polovka
Oct 8 '16 at 7:08
I copied and pasted your code using ` crontab -e` using user and root and nothing happens...
– Vitor Abella
Oct 8 '16 at 7:14
well that is unexpected, because I did the same (except I changed 15 minutes to *) and it works. Try to change the DISPLAY variable to 1 or 2, I have seen it help sometimes, although I don't fully understand why.
– Michal Polovka
Oct 8 '16 at 7:20
Do you have to reboot to start?
– Vitor Abella
Oct 8 '16 at 7:25
|
show 3 more comments
'DISPLAY=:' or 'DISPLAY='
– Vitor Abella
Oct 8 '16 at 7:02
DISPLAY=:0 , the colon is neccessary.
– Michal Polovka
Oct 8 '16 at 7:08
I copied and pasted your code using ` crontab -e` using user and root and nothing happens...
– Vitor Abella
Oct 8 '16 at 7:14
well that is unexpected, because I did the same (except I changed 15 minutes to *) and it works. Try to change the DISPLAY variable to 1 or 2, I have seen it help sometimes, although I don't fully understand why.
– Michal Polovka
Oct 8 '16 at 7:20
Do you have to reboot to start?
– Vitor Abella
Oct 8 '16 at 7:25
'DISPLAY=:' or 'DISPLAY='
– Vitor Abella
Oct 8 '16 at 7:02
'DISPLAY=:' or 'DISPLAY='
– Vitor Abella
Oct 8 '16 at 7:02
DISPLAY=:0 , the colon is neccessary.
– Michal Polovka
Oct 8 '16 at 7:08
DISPLAY=:0 , the colon is neccessary.
– Michal Polovka
Oct 8 '16 at 7:08
I copied and pasted your code using ` crontab -e` using user and root and nothing happens...
– Vitor Abella
Oct 8 '16 at 7:14
I copied and pasted your code using ` crontab -e` using user and root and nothing happens...
– Vitor Abella
Oct 8 '16 at 7:14
well that is unexpected, because I did the same (except I changed 15 minutes to *) and it works. Try to change the DISPLAY variable to 1 or 2, I have seen it help sometimes, although I don't fully understand why.
– Michal Polovka
Oct 8 '16 at 7:20
well that is unexpected, because I did the same (except I changed 15 minutes to *) and it works. Try to change the DISPLAY variable to 1 or 2, I have seen it help sometimes, although I don't fully understand why.
– Michal Polovka
Oct 8 '16 at 7:20
Do you have to reboot to start?
– Vitor Abella
Oct 8 '16 at 7:25
Do you have to reboot to start?
– Vitor Abella
Oct 8 '16 at 7:25
|
show 3 more comments
3
Try to run .sh script by editing
eval "export $(egrep -z DBUS_SESSION_BUS_ADDRESS /proc/$(pgrep -u $LOGNAME gnome-session)/environ)";
– d a i s y
Oct 8 '16 at 7:23
@Lnux , Where do I place this line? On .sh file before the
notify-send 'crontab' 'test'
?– Vitor Abella
Oct 8 '16 at 7:44
yes in your bash script before notify-send
– d a i s y
Oct 8 '16 at 7:51
on
16.04
this one worked*/1 * * * * eval "export $(egrep -z DBUS_SESSION_BUS_ADDRESS /proc/$(pgrep -u $LOGNAME gnome-session)/environ)";/usr/bin/notify-send -i appointment -c "im" "Keep Working"
– KrIsHnA
Jul 8 '18 at 5:56
* * * * * export $(egrep -z DBUS_SESSION_BUS_ADDRESS /proc/$(pgrep -u $LOGNAME gnome-session)/environ) && DISPLAY=:0 notify-send "Foo bar"
– Saeed Falsafin
Dec 21 '18 at 15:03