Saturday, June 11, 2016

CentOS 7 Minimal Installation - ‘Ifconfig’ missing



As we all know, “ifconfig” command is used to configure a network interfaces in GNU/Linux systems.
CentOS 7 minimal systems, use the commands “ip addr” and “ip link” to find the details of a network interface card.

How do I enable and use “ifconfig” Command in CentOS 7

#yum install net-tools

Now, you’ll be able to use the command ifconfig as usual.

Tuesday, June 7, 2016

Network Interfaces Name changes



What precisely has changed in v197?

With systemd 197 we have added native support for a number of different naming policies into systemd/udevd proper and made a scheme similar to biosdevname's (but generally more powerful, and closer to kernel-internal device identification schemes) the default. The following different naming schemes for network interfaces are now supported by udev natively:
  1. Names incorporating Firmware/BIOS provided index numbers for on-board devices (example: eno1)
  2. Names incorporating Firmware/BIOS provided PCI Express hotplug slot index numbers (example: ens1)
  3. Names incorporating physical/geographical location of the connector of the hardware (example: enp2s0)
  4. Names incorporating the interfaces's MAC address (example: enx78e7d1ea46da)
  5. Classic, unpredictable kernel-native ethX naming (example: eth0)

Thursday, October 15, 2015

Anacron



Anacron stands for anachronistic.

One of cron's biggest weaknesses is that it assumes that your server or computer is always on. If your machine is off and you have a task scheduled during that time, the task will never run.

This is a serious problem with systems that cannot be guaranteed to be on at any given time. Due to this scenario, a tool called "anacron" was developed. 

#vi /etc/anacrontab


The first column specifies how often the command should be run.

The second column is the delay to use before executing the commands.

For example, the first line runs every day, five minutes after anacron is called:

1       5       cron.daily       nice run-parts --report /etc/cron.daily

The following line is run weekly (every 7 days), ten minutes after anacron is called:

7       10      cron.weekly      nice run-parts --report /etc/cron.weekly

The third column contains the name that the job will be known as in the anacron's messages and log files. The fourth field is the actual command that is run.

Friday, October 9, 2015

Using "at" jobs




Using at



            The “at” command is used to schedule a one-time task at a specific time.

            Suppose you would like your computer to rebuild your Linux kernel this evening while you're at the pub. You might proceed like this:

$ at 20.30
warning: commands will be executed using /bin/sh
at> cd /usr/src/linux
at> make all
at> <EOT>
job 2 at Wed Feb 14 19:30:00 2007

As you'll see from this, at collects the commands you want to run from its standard input, up to an EOT character (^D by default).

Your list of queued jobs can be examined using atq:

$ atq
2 Wed Feb 14 19:30:00 2007 a chris
$

Controlling access “at”
/etc/at.deny

“at” utility command

atd  –    run jobs queued for later execution 
atq  –    list queue
atrm –   delete the job 
atrun-   run jobs queued for later execution

The job run immediately 
 
[root@server1 Desktop]# at now
at> uptime >> /root/Desktop/test.txt
at>
job 4 at 2012-10-26 07:53

[root@server1 Desktop]# cat test.txt
07:54:09 up  1:24,  2 users,  load average: 0.00, 0.00, 0.00

The job run 1 minutes lately current time

[root@server1 Desktop]# at now + 1 minutes
at> uptime > /root/Desktop/test.txt
at>
job 6 at 2012-10-26 07:59

[root@server1 Desktop]# atq
6          2012-10-26 07:59 a root

[root@server1 Desktop]# cat test.txt
 07:57:00 up  1:27,  2 users,  load average: 0.00, 0.00, 0.00

You can delete a job from the queue using atrm:
$ atrm 2