dnif-archive / DigiVigi

GNU General Public License v3.0
1 stars 7 forks source link

Scheduling Repository Scripts #8

Closed PRASHANT-SAWANT closed 6 years ago

PRASHANT-SAWANT commented 6 years ago

Hey Team Mates,

Does anyone know the right and easy way to schedule python scripts in Ubuntu, on a daily basis?

Need a quick one here.

shreyaskulkarni412 commented 6 years ago

@PRASHANT-SAWANT ,

Have you tried scheduler in python. It schedules the python code to be executed whenever you want. It can schedules that script periodically also.

PRASHANT-SAWANT commented 6 years ago

Sure. Will have a look into this one.

PRASHANT-SAWANT commented 6 years ago

Hey, Listing down what all I've been trying.

  1. Ran the SourceToDnif on Ubuntu(i.e server machine) but since my server is on a VM (which has one network adapter configured hard), running this script once always put my network down of Ubuntu, not the DNIF container. So after trying different networking commands and solutions, I couldn't figure much of the problem. Maybe someone might not face this issue (depends on the environment setup of everything, and also since I'm doing this at home on my laptop) Moving on...

  2. I created a python installer of SourceToDnif on host machine (i.e. Windows). Ran it, by double clicking it. It flickered the command prompt once. Then I went on to check on the WebConsole go.dnif.it ; But no output. Maybe the packets got dropped.

Moving on again... And this time I wasn't looking for more code or some way around like cron(which I did not try since the next thing worked for me)

  1. I came across a well known tool called AlwaysUp by Core Technologies. Its an amazing tool. Just tell it the python.exe and your python script path, and the time of the day you want it to run. Then just forget the rest. Just make sure your server is on, DNIF container is up and listener port service is started. Voila.

NOTE: AlwaysUp is a paid application. After a 30 days trial, some other alternative tool or solution will be required OR Pay for AlwaysUp usage if your work is making bucks for you.