Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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!

like image 351
Sam Hoppen Avatar asked Oct 29 '25 15:10

Sam Hoppen


1 Answers

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

like image 184
Russell Avatar answered Oct 31 '25 06:10

Russell



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!