8
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

WSL上cronをwindows起動時に自動実行する

Posted at

Windows Subsystem for Linux(WSL) では cron も利用できるのだが、デフォルトでは無効になっているようだ。

ということで。上記記事を噛み砕いてかつbatを簡単にしたもの。記事通りでもvisudoをいじればできるけど簡略化。

##1. Startup フォルダを開く
###方法A.
C:\Users\Nyanko\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
ユーザ名は自分のものに。
###方法B.
385e27679a761aef9fa82a79964a70ed.png

Windows キー + R同時押し後出るウィンドウ上で,shell:startup

##2. bat ファイル置く
以下なファイルを上記で開いたフォルダ以下に置く。.batで。
$ wsl -u root -- service cron start

##3. 確認
Windows 再起動後,wsl上のubuntuかなにかを開いて,
$ sudo service cron status
実行した後,* cron is runningが出ればok

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?