Linux Runlevels

Written by Vinu Thomas


Continued from page 1

Each runlevel can be configured byrepparttar system administrator. The "/etc/inittab" file has information on which runlevel to startrepparttar 107745 system at and listsrepparttar 107746 processes to be run at each runlevel.

Each runlevel has its own directory structure where you can definerepparttar 107747 order in whichrepparttar 107748 services start. These directories are located inrepparttar 107749 /etc/rc.d/ directory, under which you have rc1.d, rc2.d, rc3.d…. rc6.d directories whererepparttar 107750 number from 0 through 6 that corresponds torepparttar 107751 runlevel. Inside each directory are symbolic links that point to master initscripts found in /etc/init.d or /etc/rc.d/init.d.

You can also changerepparttar 107752 runlevel at boot time. If your system uses LILO asrepparttar 107753 boot manager, you can appendrepparttar 107754 runlevel torepparttar 107755 boot command : LILO: linux 3 or LILO: linux 5

If your system uses GRUB, you can changerepparttar 107756 boot runlevel by pressingrepparttar 107757 `e' key to editrepparttar 107758 boot configuration. appendrepparttar 107759 runlevel torepparttar 107760 end ofrepparttar 107761 boot command as shown: kernel /vmlinuz ro root=/dev/hda1 5

Vinu Thomas is a consultant on Web design and Internet Technologies. His website is http://www.vinuthomas.com. You can read more articles on Linux @ http://www.vinuthomas.com/sections-listarticles-6.html


Automating Tasks in Linux using Cron

Written by Vinu Thomas


Continued from page 1

21 1 1 * * /home/accont/clearaccount.sh

* Let's see how to schedule a task to run only on weekdays(monday to friday)

0 10 * * 1-5 /home/account/cleartemp.sh

Adding and Editing Entries in Crontab and Now that you know how crontab entries are formated, it's time to put some of your entries intorepparttar crontab list. To do this, you can userepparttar 107744 crontab command. By specifyingrepparttar 107745 -e option, you'll be taken torepparttar 107746 default text editor to add and edit your crontab list. [crontab -e]

Another method of manipulating your crontab entries is to create and save a text file with your crontab entries. You can load your list into crontab by usingrepparttar 107747 following command: [crontab mycrontablist] where mycrontablist isrepparttar 107748 file containing your entries.

Viewing Crontab: [crontab -l]

You can view your current crontab list by specifyingrepparttar 107749 -l option. Issuing this command will print out a list of all your current jobs inrepparttar 107750 crontab list

Removing Crontab: [crontab -r]

The -r option removes your current crontab file. Issuing this command will emptyrepparttar 107751 contents ofrepparttar 107752 current user's crontab file

Output from cron

Usuallyrepparttar 107753 output of cron gets mailed torepparttar 107754 owner ofrepparttar 107755 process orrepparttar 107756 person or email id specified inrepparttar 107757 MAILTO variable. To setrepparttar 107758 MAILTO variable, you'll have to addrepparttar 107759 following command torepparttar 107760 top of your crontab : MAILTO="your_email_address@domain.com"

If you have a command that is run frequently, and you don't wantrepparttar 107761 output to be emailed each time, you can redirectrepparttar 107762 output to a log file cmd >> log.file, so your job would be something like this.

0 18 * * * /home/user/backup.sh>>log.file

If you don't want any output at all, you can redirectrepparttar 107763 output to a null file : cmd>>/dev/null

0 18 * * * /home/user/backup.sh>>/dev/null

Vinu Thomas is a consultant on Web design and Internet Technologies. His website is http://www.vinuthomas.com. You can read more articles on Linux @ http://www.vinuthomas.com/sections-listarticles-6.html


    <Back to Page 1
 
ImproveHomeLife.com © 2005
Terms of Use