This is just a quick tutorial on using the AT command on Linux for some real stupid shit ;)

So, you might have read about the cron command, but life's to short for that, so enter the AT command.

If it not installed, install it with

apt install at

Now, what is it ? it's a command scheduler that allows us to schedule commands for future execution, so let's jump right in.

Invoke it with

at hour:minute

#To run a command at 14:00 hours,

at 14:00
└─# at 14:45
warning: commands will be executed using /bin/sh
at Mon Feb 28 14:45:00 2022
at> 

From there, simply just enter the command you want to run, and confirm using CTRL+D, to add it to the joblist.

To list jobs, run

atq     
12	Mon Feb 28 14:45:00 2022 a root

To see the job details, run it like so

at -c jobid

at -c 12

cd /home/nx/devel/bash || {
	 echo 'Execution directory inaccessible' >&2
	 exit 1
}
echo "this is just a test"

So, we see it's just an echo test.

To remove a job, run

atrm jobid

atrm 12

Look into the manpages, and get creative with AT.

Much Happy AT'ing :)

You have no rights to post comments