root@calleva:/var/spool/cron/atjobs# echo "sleep 3000" | at 20:58
warning: commands will be executed using /bin/sh
job 161 at Sat Jun 3 20:58:00 2023
root@calleva:/var/spool/cron/atjobs# ls
a000a101acba0e
root@calleva:/var/spool/cron/atjobs# cat a000a101acba0e
#!/bin/sh
# atrun uid=0 gid=0
# mail root 0
umask 22
LANGUAGE=en_GB:en; export LANGUAGE
PWD=/var/spool/cron/atjobs; export PWD
LOGNAME=root; export LOGNAME
XDG_SESSION_TYPE=tty; export XDG_SESSION_TYPE
MOTD_SHOWN=pam; export MOTD_SHOWN
HOME=/root; export HOME
LANG=en_GB.UTF-8; export LANG
SSH_CONNECTION=192.168.0.12\ 60848\ 192.168.0.113\ 22; export SSH_CONNECTION
XDG_SESSION_CLASS=user; export XDG_SESSION_CLASS
USER=root; export USER
SHLVL=0; export SHLVL
XDG_SESSION_ID=1202; export XDG_SESSION_ID
XDG_RUNTIME_DIR=/run/user/0; export XDG_RUNTIME_DIR
SSH_CLIENT=192.168.0.12\ 60848\ 22; export SSH_CLIENT
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/.dotnet/tools:/root/bin:/opt/mssql-tools/bin:/usr/games; export PATH
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/0/bus; export DBUS_SESSION_BUS_ADDRESS
SSH_TTY=/dev/pts/5; export SSH_TTY
OLDPWD=/root; export OLDPWD
cd /var/spool/cron/atjobs || {
echo 'Execution directory inaccessible' >&2
exit 1
}
sleep 3000
root@calleva:/var/spool/cron/atjobs# atq
161 Sat Jun 3 20:58:00 2023 a root
root@calleva:/var/spool/cron/atjobs#
Existe uma maneira de dizer que o arquivo a000a101acba0e
corresponde ao item da fila 161
?
Olhando através das fontes que encontramos
então
a000a101acba0e
é dea
para "em"000a1
para o trabalho número 161 em hex. Verificar comecho $((16#00a1))
01acba0e
para o tempo para executar o trabalho, em minutos desde a época. Verifique comecho "obase=16;$(date +%s)/60" | bc
.