Skip to content

Instantly share code, notes, and snippets.

@tkuchiki
Last active January 4, 2016 03:23
Show Gist options
  • Save tkuchiki/8116b812999caf34cb0b to your computer and use it in GitHub Desktop.
Save tkuchiki/8116b812999caf34cb0b to your computer and use it in GitHub Desktop.
at コマンド
$ at "14:50 2015-12-28" -f /path/to/file
job 1 at 2015-12-28 14:50
$ at $(LANG=C date +"%H:%M %Y-%m-%d" -d "2015-12-28T14:51") -f /path/to/file
job 2 at 2015-12-28 14:51

job 登録後は、/var/spool/at 以下にファイルができるので、
実行するコマンドを変更したい場合はこれを変更する。

#!/bin/sh
# 環境変数
# ...
cd /home/tkuchiki || {
echo 'Execution directory inaccessible' >&2
exit 1
}
${SHELL:-/bin/sh} << 'marcinDELIMITER46fe0b05'
echo test > /tmp/test
marcinDELIMITER46fe0b05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment