'How to setup scheduler task cron in windows server via .ebextensions config?
I have following config file under .ebextensions, I am using windows server 2019 as Elastic bean stalk instance
The deployment failed at this command, Same command is working when we run directly in the terminal (It configures the scheduler task inside windows)
This is what i have tried so far (FILR PATH : .ebextensions/cron.config)
container_commands:
00_cmd:
command: schtasks /create /sc minute /mo 2 /tn "S3 Operations" /tr "C:\Program Files\Amazon\AWSCLIV2\aws.exe s3 sync s3://my-bucket-url C:\inetpub\wwwroot\"
AND
commands:
00_cmd:
command: schtasks /create /sc minute /mo 2 /tn "S3 Operations" /tr "C:\Program Files\Amazon\AWSCLIV2\aws.exe s3 sync s3://my-bucket-url C:\inetpub\wwwroot\"
amazon-web-services">
amazon-web-servicesamazon-elastic-beanstalk">
amazon-elastic-beanstalkdevopswindows-server
Solution 1:[1]
It was triggering following log:
No mapping between account names and security IDs was done.
Which requires username(/ru) and password(/rp) association along with command, Alternatively you can use System user (which doesn't require any password)
So my new command would be
schtasks /create /ru "System" /sc minute /mo 2 /tn "S3 Operations" /tr "C:\Program Files\Amazon\AWSCLIV2\aws.exe s3 sync s3://my-bucket-url C:\inetpub\wwwroot\"
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Mihir Bhatt |
