Cygwin – How to Run a Command at a Certain Time

cygwin;scheduling

I am writing a bash (.sh) script for cygwin. I want to run a certain command at specific time.

I tried the following:

echo "test" | at 19:00

but I get the following error:

The AT command has been deprecated. Please use schtasks.exe instead.

So can I only use Scheduled Task in Windows for this?

Best Answer

The at command from Unix is not available on Cygwin. Cygwin has traditionally used the at command from windows, but this has been deprecated in favour of schtasks.exe.

So the answer to your question is yes: you can only use Scheduled Task in Windows for running a task once.

(You can use cron and set it on a specific date at a specific time... but it will repeat every year unless you remove the task from the crontab.) ;-)

Related Question