Cron and Crontab in Linux

  1. Cron is a daemon that executes scheduled commands in linux.
  2. Also known as clock daemon.
  3. This daemon execute so many jobs known as cron jobs.
  4. This cron jobs are described in crontab files in UNIX systems.

How to add a cron job in crontab files?

    • There are almost 7 categories. That are listed below.
      1. Minute : Add the minute here (eg : 12, 45)
      2. Hour : Add hour here (eg: 6, 17)
      3. Day Of month : Add day of month (eg : 10, 25)
      4. Month : Add month here (eg : 5, Dec, jan)
      5. Day Of Week : Add day of week (eg : 0=> sunday, 5 => friday)
      6. User : Add username
      7. Command : Add Your command here.
    An Example

Open the terminal and type
$ vim /etc/crontab
and add the following line (you can see the time by typing the date command)
50 15 * * * abhi sh /home/abhi/Project/my_project_no1/my_first_cron_job.sh
my my_first_cron_job.sh file contains:
cd /home/abhi/Projects/myProject/ && touch file1.txt file2.txt
Note : Don’t forget to give executable permission to my_first_cron_job.sh file
Here my my_first_cron_job.sh file executes at 15hr 50 min all days and creates two files named file1 and file2 in my /home/abhi/Projects/myProject folder.

# Example of job definition:
# .—————- minute (0 – 59)
#  |   .————- hour (0 – 23)
#  |   |  .———- day of month (1 – 31)
#  |   |  |   .——- month (1 – 12) OR jan,feb,mar,apr …
#  |   |  |   |   .—- day of week (0 – 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
#  |   |  |   |   |
# * * * * * user-name command to be executed

Note : You can also use * mark that denotes ‘all’. For example If you give 3 * * in day of month, month, day of week respectively ,that means it executes all month 3rd day whatever cron job you given.

Wifi no longer working on ubuntu 10.04 (Lucid)

Here describing the steps that taken by me to get the wireless connection right on my Ubuntu 10.04

After installing ubuntu 10.04, check the wireless network is enabled.

Open the terminal and type the following commands.
$ sudo su
# ifconfig
# mii-tool -A 10baseT-FD eth0
Restart your system. It will work.

If not, activate broadcom STA wireless driver in your ubuntu by going to System > Administration > Hardware drivers . Select ‘Broadcom STA’ driver and click on the activate button. Restart your system. It will work. If your system has no such driver then install it by going to System > Administration > Synaptic Package Manager. Enter root password. Type ‘broadcom’ in Quick search. Right click on broadcom-sta-common and mark for install. Then click apply.

If your system is not showing any drivers in Hardware drivers, and showing ‘No proprietary drivers are use on this system.’ then uninstall the broadcom-sta driver and bcmwl-modalises and install it again. Restart the system. It will work.
Again if it’s not working download the package rt3090-dkms_2.3.1.3-0ubuntu0~ppa1_all from here. Now install the package by double-clicking the package. Restart the system. It will be Ok.