# Running scripts outside of desktop

In the company I work for, I use several Python scripts that automate many tasks. However, this happens via the task scheduler.

I would like to ask you what solutions are you using that make this possible, outside my machine.

Do you use a Virtual Machine? Are your scripts dockerized on Kubernetes? (sorry, don't understand much of the subject).

What was are there to run tasks automatically outside ones PC?

Thank you.

My own opinion: if your scripts are still of a manageable number, then using the Task Scheduler is not a bad option. Alternatively, since you are using Python, you can use the APScheduler library to trigger scripts in-code.

I'm assuming you're looking at portability since you asked about running scripts outside your machine. One option is of course to copy-paste your codes to a remote server (can be local or cloud).

With Docker, you can basically "bundle" your scripts (see docker-compose). The sweet thing is that you are (almost) guaranteed portability, in the sense that you have the same running environment across all machines (assuming the same Docker version; there are also some nuances with OS compatibility). Then, you can package these scripts into "images" which can be run as "containers" on any machine.

• For many years I used a Windows PC in a data closet, remotely accessible using Teamviewer or AnyDesk (or Chrome Remote Desktop). Jobs were scheduled to run at night using Windows Task Scheduler. The input and output files kept on a shared Dropbox drive. More recently I switched to Docker which offers some additional conveniences, but is not absolutely essential for my application. Mar 1 at 10:58
• Hi @matt, thank you very much for your answer. Am I to believe that you are referring to Kubernetes? Indeed my main worry is to have the scripts running even if my machine is turned of, so that tasks continue to be ran. I guess the remote server is the solution then! Mar 1 at 22:00
• Hey @Rodrigo, sorry for the late reply. I meant Docker as I find the barrier to entry low in comparison to its reward (portability to other machines) — see docs.docker.com/compose/gettingstarted. Another machine is definitely needed (be it on-premise or cloud) if you don't want to run on your existing. AFAIK, Kubernetes takes Docker a step further via orchestration (e.g. scaling, load-balancing, scheduling). I think for a basic use case it's an overkill, but I'm not an expert. You may refer to stackoverflow.blog/2021/07/21/…
– matt
Mar 10 at 7:45

But if you prefer a more linux-y solution, you can download WSL https://docs.microsoft.com/en-us/windows/wsl/install + https://ubuntu.com/wsl and use cron.