LoginSignup
2
3

More than 5 years have passed since last update.

手動でファイルロック

Last updated at Posted at 2014-11-26

テスト時に迷ったのでメモ。

flockを利用する。※60秒間ロックする場合

$flock --timeout=60 ロックするファイルパス sleep 60s

flockの書式「flock オプション ファイル名 コマンド」なので、こんな感じでOK。

2
3
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
2
3