TheDeveloperBlog.com

Home | Contact Us

C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML

Python Website Blocker | Script Deployment on Linux

Python Website Blocker | Script Deployment on Linux with python tutorial, tkinter, button, overview, entry, checkbutton, canvas, frame, environment set-up, first python program, basics, data types, operators, etc.

<< Back to PYTHON

Script deployment on Linux

Hence, we are done with the python script (blocker.py) which is running fine. This is the time to deploy this script at system startup.

The process to deploy a script to run at startup depends upon the operating system. In this section of the tutorial, we will describe the process for Linux and windows.

Procedure

To schedule a script to run at startup on Linux, we need to configure the entry in the crontab schedule.

The crontab can be defined as the list that contains the commands that are to be run on a regular schedule. The crontab stands for cron table which is a set schedule according to which the script is executed on a regular interval.

Follow the following steps.

Step 1:

Open the crontab with the -e flag. Run the following command on the terminal on Linux.

$ sudo crontab -e 

This will open a crontab file which looks like following.

Script deployment on Linux

Step 2

Now add the following line to the file and save it.

@reboot python3 /home/TheDeveloperBlog/Desktop/Python/website_blocker/blocker.py
Script deployment on Linux

Step 3

Restart the system now. On reboot, our script blocker.py is scheduled to run at system start-up. As of now, we are in working hours. So let's try to open the Facebook on the browser.

Script deployment on Linux

As shown in the above image, the website www.facebook.com is refused to connect. Hence, our script is working fine on the system start-up as the website is refused to connect.





Related Links:


Related Links

Adjectives Ado Ai Android Angular Antonyms Apache Articles Asp Autocad Automata Aws Azure Basic Binary Bitcoin Blockchain C Cassandra Change Coa Computer Control Cpp Create Creating C-Sharp Cyber Daa Data Dbms Deletion Devops Difference Discrete Es6 Ethical Examples Features Firebase Flutter Fs Git Go Hbase History Hive Hiveql How Html Idioms Insertion Installing Ios Java Joomla Js Kafka Kali Laravel Logical Machine Matlab Matrix Mongodb Mysql One Opencv Oracle Ordering Os Pandas Php Pig Pl Postgresql Powershell Prepositions Program Python React Ruby Scala Selecting Selenium Sentence Seo Sharepoint Software Spellings Spotting Spring Sql Sqlite Sqoop Svn Swift Synonyms Talend Testng Types Uml Unity Vbnet Verbal Webdriver What Wpf