简体   繁体   中英

How can I run a cmd script while my computer is off?

I currently have a cmd script set up on my computer in conjunction with a scheduled task that's supposed to run every 15 minutes. The script runs a python program that is also on my computer and then uploads the file that's created to my Github repository. However, this scheduled task doesn't run when my computer is completely shut down and I don't want to have my computer on 24/7.

Is there a way to run a cmd script with my computer off? I've heard of potential solutions with an Amazon Web Services account or a DigitalOcean droplet, but I'm novice (at best) with my understanding of how that works. Any suggestions or links to resources would be appreciated!

There's no way to run anything on your computer with it powered off.

You could set up a low-cost Linux VPS with any cloud compute provider (AWS, DigitalOcean, Microsoft Azure, Google Cloud Platform, Vultr, etc.), migrate your python program to it, and schedule that program to run every 15 minutes on there.

DigitalOcean: How to set up an Ubuntu 20.04 server

You would need to keep that VPS turned on, and in place of Task Scheduler, you could schedule your Python program to run (with any arguments) as a cron job.

DigitalOcean: How to use Cron to automate tasks

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM