Linux: This Book Includes 4 Manuscripts. The Underground Bible to the unix operating System with Tools On Security and Kali Hacking to Understand Computer Programming, Data Science and Command Line




Download 6,34 Mb.
Pdf ko'rish
bet114/203
Sana10.01.2024
Hajmi6,34 Mb.
#134102
1   ...   110   111   112   113   114   115   116   117   ...   203
Bog'liq
Linux This Book Includes 4 Manuscripts The Underground Bible

Automatic tasks
Automatic tasks are those tasks that the program will run on their own
without having any manual interruption. The user does not necessarily need
to input any commands for them to run. For example, when opening a
program, the user will have to start it. The few steps and phases that follow
are automatic. In most programs, once they are run, they begin by
displaying the word ‘welcome.’ The word will then be followed by actions
such as gathering information, then asks the user to input their password.
All these actions run at a specified interval of time. While all these actions
are running from the welcome message to request for a password, the user
has not interfered in any way. The user may not have input any commands
to the program as well. Therefore, these actions or tasks are running alone.
The running of these tasks once the application has been running is what
makes them automatic tasks. One action sets in motion another action or
many more actions to help reduce the number of activities that the user has
to carry out. The automatic tasks are also known as scheduled tasks as they
are set to take place right after something else happens. They are, in a way
triggered by other tasks.
Scheduling tasks on Linux
Scheduling tasks on Linux is like preparing and setting a sequence for
actions or tasks to initiate themselves when specific actions take place. On
Linux, one has to use the crown daemon that will help to run the tasks at
specific times. When tasks are added to crontab files using the right syntax,
then they will run automatically as previously planned. In many cases,
scheduling serves in automating backups, maintaining systems, and even
running repetitive tasks. At times the tasks can be too many for the user to
complete single-handedly, they will, therefore, be automated to ensure that
they run on themselves.
Scheduling/ automating tasks
The automation of tasks on Linux follows a few steps to complete. The
steps will be executed as follows.
1. 
Open Crontab
In this step, the user will open a terminal on their computer. When the
terminal is open, the user will type crontab -e . This command opens the


user account’s crontab file. In this file, commands run on permissions from
the user. If one wants commands to run on the system’s approval, one will
use the sudo crontab -e command. This command helps the user to access
the root account’s crontab file. The system may ask one to select an editor
and in most cases, select nano. Nano is selected in many cases as it is the
easiest to use. Selection is made by simply typing the number of the editor
and pressing enter.
2. 
Adding new tasks
After opening the crontab, the user will use the page down tab to move to
the bottom of the file. From there, they can schedule their tasks. There is a
specific format required to be followed when scheduling tasks or
automating them. Setting the time for the tasks to begin, one used the
following format minute (0-59) hour (0-23) day (1-31) month (1-12)
weekday (0-6) command. In this command, it is imperative to note that in
minutes and weekdays, the first is 0 this means that the first day of the week
will be given zero, thirty minutes will be 29 and so on. The asterisk (*) is
used to show repetition and can be used to represent any value. For
example, if you want a command to run every day at 12.30 am, the
command will be as follows.
29 0 * * * /usr/bin/ example
Use values separated by commas to specific multiple times. For instance, a
line such as
0,14,29,44 * * * * /usr/ bin/ example2
runs /usr/bin/example2 at the 15-minute mark on every hour, every day.
Make sure you add each new task on a new line.
3. 
Save the file
Once you have scheduled the tasks, the user can then save them as they
want. The saving process is achieved through the use of Ctrl - O then enter.
After saving the file, one can exist by merely using the shortcut Ctrl - X.



Download 6,34 Mb.
1   ...   110   111   112   113   114   115   116   117   ...   203




Download 6,34 Mb.
Pdf ko'rish

Bosh sahifa
Aloqalar

    Bosh sahifa



Linux: This Book Includes 4 Manuscripts. The Underground Bible to the unix operating System with Tools On Security and Kali Hacking to Understand Computer Programming, Data Science and Command Line

Download 6,34 Mb.
Pdf ko'rish