I use cron to schedule things in Linux, but recently I discovered the "at" command.
sudo apt-get install at
I don't understand the scope from which this command operates:
- How would you schedule a command with at, that normally requires admin privileges?
- What is the working directory (pwd) of a command scheduled with at?
Additionally, everything I've tried so far, didn't achieve what I was trying to do.
For example, I tried to launch gedit one minute from now:
echo "gedit" | at now + 1 minute
I waited a minute, and nothing happened.
I tried to turn off my monitor one minute from now:
echo "xset dpms force off" | at now + 1 minute
I waited a minute and nothing happened.
If I can't get "at" to reliably perform a task one minute from now, how can I be certain that it will perform something I tell it to do tomorrow and beyond?
What am I missing here?
Try instead:
You will find
/tmp/at_test
after command executed.If you want to run some GUI app you should specify
DISPLAY
variable; Useecho $DISPLAY
to find out you displayPiping is also ok: