LoginSignup
5
3

More than 3 years have passed since last update.

WSLの`cron`

Posted at

WSLはバックグラウンド実行できるようになりcronの実行もできますが、自動実行まではできません。
そこでWindows起動時にcronを立ち上げるよう以下のバッチをスタートアップに登録しています。

WSLには予めexpectのインストールが必要です

wsl expect -c ^
"spawn sudo service cron start; ^
expect \"sudo\"; ^
send \"password\n\"; ^
expect \"$\"; exit 0;"
5
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
5
3