LoginSignup
0
0

More than 3 years have passed since last update.

linux at command

Posted at

linux at command 意外と使える!ので、ここでメモ。

コマンド指定(ctrl+dで終了)

22:59:18 root@localhost ~ [0] # at 23:30
at> touch 1.txt
at> <EOT>
job 10 at Thu Oct 22 23:30:00 2020
22:59:37 root@localhost ~ [0] #

待ち行列表示

23:00:59 root@localhost ~ [0] # at -l
10      Thu Oct 22 23:30:00 2020 a root
23:01:00 root@localhost ~ [0] #

コマンド内容を表示。ちゃんと現在のフォルダまで移動したね。

23:01:48 root@localhost ~ [0] # at -c 10
#!/bin/sh
# atrun uid=0 gid=0
# mail root 0
umask 22
XDG_SESSION_ID=16340; export XDG_SESSION_ID
HOSTNAME=localhost; export HOSTNAME
SELINUX_ROLE_REQUESTED=; export SELINUX_ROLE_REQUESTED
SHELL=/bin/bash; export SHELL
HISTSIZE=1000; export HISTSIZE
SELINUX_USE_CURRENT_RANGE=; export SELINUX_USE_CURRENT_RANGE
SSH_TTY=/dev/pts/0; export SSH_TTY
USER=root; export USER
MAIL=/var/spool/mail/root; export MAIL
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin; export PATH
PWD=/root; export PWD
LANG=ja_JP.UTF-8; export LANG
PS1=\\t\ \\u@\\h\ \\w\ [\${PIPESTATUS[@]}]\ \\\$\ ; export PS1
SELINUX_LEVEL_REQUESTED=; export SELINUX_LEVEL_REQUESTED
HISTCONTROL=ignoreboth; export HISTCONTROL
SHLVL=1; export SHLVL
HOME=/root; export HOME
LOGNAME=root; export LOGNAME
LESSOPEN=\|\|/usr/bin/lesspipe.sh\ %s; export LESSOPEN
XDG_RUNTIME_DIR=/run/user/0; export XDG_RUNTIME_DIR
cd /root || {
         echo 'Execution directory inaccessible' >&2
         exit 1
}
${SHELL:-/bin/sh} << 'marcinDELIMITER54cbc56c'
touch 1.txt

marcinDELIMITER54cbc56c
23:01:53 root@localhost ~ [0] #

コマンド削除

23:03:58 root@localhost ~ [0] # at -l
10      Thu Oct 22 23:30:00 2020 a root
23:04:06 root@localhost ~ [0] # at -r 10
23:04:11 root@localhost ~ [0] # at -l
23:04:14 root@localhost ~ [0] #

以上。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0