0

Configured crontab to run a script.

crontab config

* * * * * export DISPLAY=:0 && sh $HOME/path/to/script >> /tmp/error.llog 2>&1

Script

gnome-terminal --window -e "sudo ifconfig wlo1 down; sleep 1; sudo ifconfig wlo1 up"

Whenever the script is executed I'm getting the following error message.

Error constructing proxy for org.gnome.Terminal:/org/gnome/Terminal/Factory0: Could not connect: Connection refused

Locale configs

LANG=en_IN
LANGUAGE=en_IN:en
LC_CTYPE="en_IN"
LC_NUMERIC="en_IN"
LC_TIME="en_IN"
LC_COLLATE="en_IN"
LC_MONETARY="en_IN"
LC_MESSAGES="en_IN"
LC_PAPER="en_IN"
LC_NAME="en_IN"
LC_ADDRESS="en_IN"
LC_TELEPHONE="en_IN"
LC_MEASUREMENT="en_IN"
LC_IDENTIFICATION="en_IN"
LC_ALL=

1
  • Comments indicate that this "script is working on the ubuntu 21.04 machine but it is not working on a 16.04 machine". Debugging an EOL system is out of scope of the site.
    – vanadium
    Commented Jan 9, 2022 at 11:38

1 Answer 1

1

You really do not want to open Gnome Terminal this way. Cron is not designed to be used for starting graphical applications. Use "autostart" in your desktop environment to automatically open a terminal emulator.

3
  • It is a time-triggered script and so I'm using crontab. The script is working on the ubuntu 21.04 machine but it is not working on a 16.04 machine Commented Jan 7, 2022 at 9:24
  • Does your question relate to Ubuntu 16.04? That looks a pretty old version to me for which the site does not anymore give support.
    – vanadium
    Commented Jan 7, 2022 at 14:50
  • Yes, the Ubuntu version is 16.04. The site doesn't give any support but the crontab should work right? Commented Jan 8, 2022 at 21:20

Not the answer you're looking for? Browse other questions tagged .