EC2가 실행되는 동안 Windows Server 2016 EC2 인스턴스 aws에서 스케줄러가 작동하지 않습니까?

EC2가 실행되는 동안 Windows Server 2016 EC2 인스턴스 aws에서 스케줄러가 작동하지 않습니까?

창에서 Python 스크립트를 실행하기 위해 몇 가지 배치 파일을 설정했습니다. 실행 중인 스크립트를 표시하기 위해 CMD를 실행하는 배치 파일을 두 번 클릭하여 배치 파일이 작동하는지 확인했습니다.

배치 파일을 시작하기 위해 작업 스케줄러를 설정하고 작업 스케줄러 GUI에서 '실행' 버튼을 눌러 테스트했습니다.

EC2 인스턴스는 항상 실행 중이지만 EC2 인스턴스용 원격 데스크톱 애플리케이션을 닫으면 작업 스케줄러가 스크립트를 시작하지 않습니다. 내가 도대체 ​​뭘 잘못하고있는 겁니까? 데스크탑을 볼 수 있는지 여부에 관계없이 작업 스케줄러가 실행되기를 원합니다.

도움이 된다면 Mac을 사용하여 EC2 인스턴스에 원격으로 접속하고 있습니다. 또한 이것만큼 심층적인 창 작업에 매우 새로운 것입니다.

미리 감사드립니다.

편집하다:

bat 파일 설정:

@echo off
python C:\folder\folder\pythonscript.py %*
pause

스케줄러 설정:

General Tab:
(checked) Run whether user is logged on or not
(checked) Run with highest privileges
Running as admin on local computer

Trigger Tab:
(checked) Daily
Recur every 1 day
(checked) repeat task every 1 min for duration 'indefinite" ----this is for testing
(checked) Enabled

Actions Tab:
Action: start a program
Program/script: C:\folder\bat_files\test.bat
Add Arguments(optional): blank
Start In(optional): blank

Conditions Tab:
(checked) start the task only if the computer is on AC power
(checked) Stop if computer switches to battery power
(checked) Wake the computer to run task

Settings Tab:

(checked) Allow task to be run on demand
(checked) Run task as soon as possible after schedule is missed
(checked) if task fails, restart every 1 min

답변1

여러 가지가 있을 수 있지만 제공한 설명에 따라 Windows 작업 스케줄러의 모든 설정이 정확하고 시스템 사용자가 GUI 모드로 로그인할 때 정상적으로 실행되는 경우 실행하려면 지속적인 GUI 모드가 필요할 수 있는 Python 스크립트와 관련이 있을 수 있습니다. 로컬 시스템에서도 동일한 작업을 확인할 수도 있습니다.

또한 Sysprep과 관련된 내용이 있는지 아래 링크를 확인하여 추가로 게시해 주시기 바랍니다. https://support.microsoft.com/en-in/help/253942/fix-task-scheduler-task-only-runs-in-the-Background-after-you-use-sysp

관련 정보