Ubuntu – How to send a notification using at command

at-commandcommand line

I have a bash script that runs periodically once a day using crontab.

The script checks a condition, and if true, it should issue an at command at a specific time.

at 14:10 <notify-send hello>

The question is: how can I add a specific command like notify-send to the at command?

Best Answer

echo "notify-send 'hello'" | at 14:10

at is expecting a command from STDIN.

If you want to silence the /bin/sh warning, run it this way:

echo "notify-send 'hello'" | at 14:10 2>/dev/null