Linux - Unix Learning

LINUX - UNIX Administration Learning

Friday, September 3, 2010

How to setup linux samba

Objective:

To setup a Linux file server using Samba on Centos 5.4

Actions Taken:

I. Installed the following:
    - samba-common-3.0.33-3.14.el5
    - samba-3.0.33-3.14.el5
    - system-config-samba-1.2.41-5.el5
    - samba-client-3.0.33-3.14.el5

II. Add current linux users to samba users (example: user fpg must exist in /etc/passwd):

# smbpasswd -a fpg  yourpassword

III. Here's a sample /etc/samba/smb.conf:

[global]
        workgroup = MYGROUP
        netbios name = MEDIAS
        server string = Samba Server Version %v
        security = SHARE
        passdb backend = tdbsam
        log file = /var/log/samba/log.%m
        max log size = 50
        hosts allow = 127., 192.168.8., 192.168.10.

[Media]
        comment = Music and Video Collections
        path = /mnt/MEDIA
        read only = No
        guest ok = Yes


Notes:

In the [global] section, the interfaces option will serve workstations that belongs 192.168.8 and 192.168.10 block. 

Windows 95/98/ME/NT4/2000 clients must logon to the samba server using their samba username when Windows starts up.

IV. Restart Samba:

# /etc/rc.d/init.d/smb restart

Monday, August 30, 2010

Oracle Installation Guide - Ivan-kartik

Installation of Oracle 9i (R2) on Fedora Core Linux 2, 3, 4, 5 and 6


This paper (HOWTO) describes step-by-step installation of Oracle 9i database software on Fedora Core 2, 3, 4, 5 and 6.

This paper covers following steps:

Pre-Instalation Tasks

1. Create oracle User Account

Login as root and create te user oracle which belongs to dba group.
su -
# groupadd dba
# useradd -g dba oracle

2. Setting System parameters
Edit the /etc/sysctl.conf and add following lines:
kernel.sem = 250 32000 100 128
kernel.shmmax = 2147483648
kernel.shmmni = 128
kernel.shmall = 2097152
kernel.msgmnb = 65536
kernel.msgmni = 2878
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
Note: You need execute "sysctl -p" or reboot system to apply above settings.

Edit the /etc/security/limits.conf file and add following lines:
* - nproc 16384
* - nofile 16384

3. Setting Oracle Enviroment
Edit the /home/oracle/.bash_profile file and add following lines:

Settings for Fedora Core 2,3,4 only. For Fedora Core 5 and 6 use the next settings.
ORACLE_BASE=/opt/oracle
ORACLE_HOME=$ORACLE_BASE/920
ORACLE_SID=MY_ORACLE
LD_LIBRARY_PATH=$ORACLE_HOME/lib
LD_ASSUME_KERNEL=2.4.1
THREADS_FLAG=native
ORACLE_OEM_JAVARUNTIME=/opt/jre1.3.1_15
PATH=$PATH:$ORACLE_HOME/bin

export ORACLE_BASE ORACLE_HOME ORACLE_SID LD_LIBRARY_PATH LD_ASSUME_KERNEL THREADS_FLAG ORACLE_OEM_JAVARUNTIME PATH

Settings for Fedora Core 5 and 6 only. For Fedora Core 2,3,4 use the above settings. Note setting of LD_ASSUME_KERNEL will cause incorrect functionality of FC5 and FC6.
ORACLE_BASE=/opt/oracle
ORACLE_HOME=$ORACLE_BASE/920
ORACLE_SID=MY_ORACLE
LD_LIBRARY_PATH=$ORACLE_HOME/lib
ORACLE_OEM_JAVARUNTIME=/opt/jre1.3.1_15
PATH=$PATH:$ORACLE_HOME/bin

export ORACLE_BASE ORACLE_HOME ORACLE_SID LD_LIBRARY_PATH ORACLE_OEM_JAVARUNTIME PATH

Save the .bash_profile and execute following commands for load new enviroment:
cd /home/oracle
. .bash_profile

4. Create base directory for Oracle

Login as root and create base directory for Oracle ($ORACLE_BASE).
su -
# cd /opt
# mkdir oracle
# chown oracle:dba oracle

Download & Install

1. Download and install required .rpm packages

Some additional packages are required for succesful instalation of Oracle software. To check whether required packages are installed on your operating system use following command:
rpm -q gcc glibc-headers glibc-kernheaders glibc-devel compat-libstdc++ cpp compat-gcc
Note: You don't need glibc-kernheaders installed on FC6 as this package is not shipped with FC6.
If some package is not installed download it from Fedora project website or direct from Core 2, Core 3, Core 4, Core 5, Core 6 locations.

This step is required for Fedora Core 3 and 4 only. Fedora Core 3 is shipped with compat-gcc-8.3.3.4. Fedora Core 4 is shipped with compat-gcc-32-3.2.3. These package are GCC 3.x compiler which are not useful for succesful inatallation. Check whether compat-gcc-8.3.3.4 or compat-gcc-32-3.2.3 is installed. If so then uninstall it using folowing command:
rpm -e compat-gcc
Download the compat-gcc-7.3-2.96.126.i386.rpm package from Core 2 location or from here.


Install the required packages using the rpm command (Note version of packages may change in newer release, so versions for all packages (except compat-gcc package) used in next command are just for example.):
# rpm -ivh gcc-3.4.2-6.fc3.i386.rpm \
glibc-headers-2.3.3-74.i386.rpm \
glibc-kernheaders-2.4-9.1.87.i386.rpm \
glibc-devel-2.3.3-74.i386.rpm \
compat-libstdc++-3.4.2-6.fc3.i386.rpm \
cpp-3.4.2-6.fc3.i386.rpm \
compat-gcc-7.3-2.96.126.i386.rpm


For Fedora Core 4, 5 and 6 only:Install the required additional packages using the rpm command:
# rpm -ivh compat-libgcc-296-2.96-___.rpm \
compat-libstdc++-33-3.2.3-___.rpm \
compat-libstdc++-296-2.96-___.rpm

If all required packages were installed succesfuly then login as root and switch the GCC3 compiler binary with GCC2 compiler binary as following:
su -
# cd /usr/bin
# mv ./gcc ./gcc3
# mv ./gcc296 ./gcc

2. Download the Java Runtime Enviroment (j2re-1_3_1_15-linux-i586.bin) from the Sun website. Keep in mind you need to download j2re1.3.1_11 or higher (Note: Install JRE 1.3.1_1x version only).

Login as root and make the the file executable and then execute it. When the JRE is exracted move the "jre1.3.1_15" di rectory to "/opt" directory.
# chmod +x j2re-1_3_1_15-linux-i586.bin
# ./j2re-1_3_1_15-linux-i586.bin

# mv jre1.3.1_15 /opt/

3. Download the Oracle 9i (9.2.0.4) software from Oracle website.
Extract the files using following command:
gunzip ship_9204_linux_disk1.cpio.gz
gunzip ship_9204_linux_disk2.cpio.gz
gunzip ship_9204_linux_disk3.cpio.gz

cpio -idmv < ship_9204_linux_disk1.cpio
cpio -idmv < ship_9204_linux_disk2.cpio
cpio -idmv < ship_9204_linux_disk3.cpio

When all archives were extracted you've got three directories Disk1, Disk2 and Disk3.
Edit the Disk1/install/linux/oraparam.ini and modify JRE_LOCATION variable and set path to our JRE installation from Step 2.

JRE_LOCATION=/opt/jre1.3.1_15

4. Start the Oracle software installation process.

Now the system is prepared for Oracle software installation. To start the installation process execute the following commands:
cd Disk1
./runInstaller

When network configuration assistant and database configuration assistant has failed during st artup then do following steps:
cd /opt/oracle/920
rm JRE
ln -s /opt/jre1.3.1_15 JRE
su -
# cd /opt/oracle/920/JRE/bin
# ln -s java jre
# cd i386/native_threads
# ln -s java jre

Post-Instalation Tasks

1. Switch back the GCC binaries
su -
# cd /usr/bin
# mv ./gcc ./gcc296
# mv ./gcc3 ./gcc

2. Change of JRE path in Oracle Universal Installer

Edit the $ORACLE_BASE/oui/oraparam.ini file and modify the value of JRE_LOCATION to /opt/jre1.3.1_15

3. (Optional) You may consider to use rlwrap for comfortable work with sqlplus. RPM package for Fedora Core (x86) distribution you can download here.
su -
# rpm -ivh rlwrap-0.24.fedora.i386.rpm
# exit
echo "alias sqlplus='rlwrap sqlplus'" >> /home/oracle/.bash_profile
. /home/oracle/.bash_profile


Common Installation Errors

Unable to load native library: /tmp/OraInstall2005-01-08_11-11-34AM/jre/lib/i386/libjava.so: symbol __libc_wait, version GLIBC_2.0 not defined in file libc.so.6 with link time reference
Solution: Install new JRE 1.3.1 version. Edit the Disk1/install/linux/oraparam.ini and set path to new JRE for JRE_LOCATION variable. For more information see Download & Install section.

/tmp/OraInstall2005-04-26_11-38-19AM/jre/lib/i386/libawt.so: libXp.so.6: cannot open shared object file: No such file or directory
Solution: Install the xorg-x11-deprecated-libs package (for >=FC4 versions). For FC5 and later install libXp package.

/tmp/OraInstall2005-06-14_03-46-25PM/jre/bin/i386/native_threads/java: error while loading shared libraries: /tmp/OraInstall2005-06-14_03-46-25PM/jre/lib/i386/native_threads/libhpi.so: cannot restore segment prot after reloc: Permission denied
Solution: Modify /etc/selinux/config and change value of SELINUX to "disabled" and reboot computer.

Starting Oracle Intelligent Agent.../opt/oracle/920/bin/dbsnmpwd: line 156: 1393 Segmentation fault nohup $ORACLE_HOME/bin/dbsnmp $* >>$DBSNMP_WDLOGFILE 2>&1
/opt/oracle/920/bin/dbsnmpwd: line 156: 1405 Segmentation fault nohup $ORACLE_HOME/bin/dbsnmp $* >>$DBSNMP_WDLOGFILE 2>&1
/opt/oracle/920/bin/dbsnmpwd: line 156: 1416 Segmentation fault nohup $ORACLE_HOME/bin/dbsnmp $* >>$DBSNMP_WDLOGFILE 2>&1
/opt/oracle/920/bin/dbsnmpwd: line 156: 1427 Segmentation fault nohup $ORACLE_HOME/bin/dbsnmp $* >>$DBSNMP_WDLOGFILE 2>&1

Solution: Download and apply patch nr.: 3238244 from http://metalink.oracle.com.

Exception in thread "main" java.lang.InternalError: Can't connect to X11 window server using 'localhost:0.0' as the value of the DISPLAY variable.
Solution: Execute "export DISPLAY=:0.0" (as oracle user) and "xhost +" as user who has opened X session (for example logged in KDE, GNOME, etc.). If the value is other than 127.0.0.1 or localhost you should "xhost +" on client machine.

Error in invoking target install of makefile /opt/oracle/920/ctx/lib/ins_ctx.mk
Error in invoking target install of makefile /opt/oracle/920/precomp/lib/ins_precomp.mk
Error in invoking target install of makefile /opt/oracle/920/plsql/lib/ins_plsql.mk
Error in invoking ntcontab.o of makfile /opt/oracle/920/network/lib/ins_net_client.mk

Solution: Install the compat-gcc-7.3-2.96.126.i386.rpm (gcc 2.96) package and change the GCC binaries. For more information see Download & Install section. In case of Fedora Core 5 take look at next error message.

sed: -e expression #1, char 7: unterminated `s' command error in $ORACLE_HOME/install/make.log
Solution: There is probably bug in bash (FC5 only). Download and install bash package from FC4. I have prepared this package (builded from FC4 src.rpm) for FC5 - Download.
Install it using "rpm -ivh bash-3.0-31.i386.rpm --force".

Initializing Java Virtual Machine from /tmp/OraInstall2006-10-25_01-43-30PM/jre/bin/java. Please wait... /tmp/OraInstall2006-10-25_01-43-30PM/jre/bin/i386/native_threads/java: error while loading shared libraries: libstdc++-libc6.1-1.so.2: cannot open shared object file: No such file or directory - after ./runInstaller execution.
Solution:
su -
# cd /usr/lib
# ln -s libstdc++-3-libc6.2-2-2.10.0.so libstdc++-libc6.1-1.so.2

Start ./runInstaller again.


Last update: 25-10-2006. Comments, suggestions, questions, errors (also grammatical :) )? Feel free to contact me.

Oracle Installation Guide - Oracle Base

Oracle9i (9.2.0.4.0) Installation on RedHat Advanced Server 2.1 Linux

This article is intended as a brief guide to installing Oracle9i (9.2.0.4.0) on RedHat Advanced Server 2.1 Linux. For additional information and platform variations read the Installation Guide for UNIX Systems.

Download Software

Download Sun's Java Development Kit (JDK 1.3.1).

Download the Oracle installation files from otn.oracle.com.

Unpack Files

First unzip the files:
gunzip ship_9204_linux_disk1.cpio.gz
gunzip ship_9204_linux_disk2.cpio.gz
gunzip ship_9204_linux_disk3.cpio.gz
Next unpack the contents of the files:
cpio -idmv < ship_9204_linux_disk1.cpio
cpio -idmv < ship_9204_linux_disk2.cpio
cpio -idmv < ship_9204_linux_disk3.cpio
You should now have three directories (Disk1, Disk2 and Disk3) containing installation files.

Hosts File

The /etc/hosts file must contain a fully qualified name for the server:
    

Set Kernel Parameters

Add the following lines to the /etc/sysctl.conf file:
kernel.shmmax = 2147483648
kernel.shmmni = 128
kernel.shmall = 2097152
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
Run the following command to change the current kernel parameters:
/sbin/sysctl -p
Add the following lines to the /etc/security/limits.conf file:
oracle soft nofile 65536
oracle hard nofile 65536
oracle soft nproc 16384
oracle hard nproc 16384

Setup

Install the Java development kit:
# Run the bin file. Agree to the terms and conditions.
./j2sdk-1_3_1_17-linux-i586.rpm.bin
# Install the RPM file.
rpm -ivh jdk-1.3.1_17.i586.rpm
Create the new groups and users:
groupadd oinstall
groupadd dba
groupadd oper
groupadd apache

useradd -g oinstall -G dba oracle
passwd oracle

useradd -g oinstall -G apache apache
passwd apache
Create the directories in which the Oracle software will be installed:
mkdir -p /u01/app/oracle/product/9.2.0
chown -R oracle.oinstall /u01
Login as the oracle user and add the following lines at the end of the .bash_profile file:
# Oracle 9i
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/9.2.0; export ORACLE_HOME
ORACLE_TERM=xterm; export ORACLE_TERM
PATH=$ORACLE_HOME/bin:$PATH:/usr/java/jdk1.3.1_17/bin; export PATH
ORACLE_OWNER=oracle; export ORACLE_OWNER
ORACLE_SID=TSH1; export ORACLE_SID

LD_LIBRARY_PATH=$ORACLE_HOME/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH
ORACLE_OEM_JAVARUNTIME=/usr/java/jdk1.3.1_17; export ORACLE_OEM_JAVARUNTIME

TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
Save the .bash_profile file and re-login as the oracle user. Make sure the .bash_profile ran correctly by issuing the following command:
set | more

Installation

Log into the oracle user. If you are using X emulation then set the DISPLAY environmental variable:
DISPLAY=:0.0; export DISPLAY
Start the Oracle Universal Installer (OUI) by issuing the following command in the Disk1 directory:
./runInstaller
During the installation enter the appropriate ORACLE_HOME and name then continue as normal. For a more detailed look at the installation process, click on the links below to see screen shots of each stage.
  1. Welcome
  2. Inventory Location
  3. UNIX Group Name
  4. UNIX Group Name Privileges Dialog
  5. File Locations
  6. Available Products
  7. Installation Types
  8. Database Configuration
  9. Database Identification
  10. Database File Location
  11. Database Character Set
  12. Summary
  13. Install
  14. Setup Privileges
  15. Configuration Tools
  16. Database Configuration Assistant
  17. Database Configuration Assistant Passwords
  18. End Of Installation

Post Installation

Once the instance is created edit the /etc/oratab file setting the restart flag for each instance to 'Y':
TSH1:/u01/app/oracle/product/9.2.0:Y
For more information see:

Tuesday, August 17, 2010

How to disable Account user in linux

Command to disable the account in linux

    step 1:chsh -list

        [root@nocdev ~]# chsh -list
        /bin/sh
        /bin/bash
        /sbin/nologin
        /bin/tcsh
        /bin/csh
        /bin/ksh
        /bin/zsh


    step 2:chsh 12345
   
        [root@nocdev ~]# chsh 12345
        Changing shell for 12345.
        New shell [/bin/bash]:    type > /sbin/nologin = to change login shell

    Step 3: To check if the user account is disable.

        [root@nocdev ~]# su - 1234
        This account is currently not available.
        [root@nocdev ~]#

       

Jboss - Jdk Installation


JBoss Application Server is the #1 most widely used Java application server on the 
market. Hundreds of professional open source developers have contributed to the JBoss Application Server over the years and community contributors are not only welcome but encouraged. In fact all JBoss employed contributors to the JBoss Application Server were hired from the community and each of them contributed to an open source project in one way or another.


SOURCE NEEDED:


-- java_ee_sdk-5_01-linux.bin >> http://java.sun.com/javase/downloads/index_jdk5.jsp

-- java-1.5.0-sun-compat-1.5.0.08-1jpp.noarch.rpm >> ftp://jpackage.hmdc.harvard.edu/JPackage/1.7/generic/RPMS.non-free/

-- jboss-5.1.0.GA.zip >> http://labs.jboss.com/jbossas/downloads/


JDK INSTALLATION:


Install java using gui base or install using x-windows.

1.) run ./java_ee_sdk-5_01-linux.bin

-- Input the following details in java gui base console

-- Admin

-- Admin Password: (any password)

-- Admin Port: 4848

-- HTTP Port: 8080

-- HTTPS Port: 8181

-- After the installation do not click the start button, choose finish button instead.


2.) Install JAVA compat

-- rpm -i --nodeps java-1.5.0-sun-compat-1.5.0.08-1jpp.noarch.rpm


3.) Create environment variable. Add the following lines to the .bashrc


Ex:

-- cd /home/jboss

-- ll -la

-- [root@jbossdev jboss]# ll -la

    -rw-r--r-- 1 jboss jboss 242 Jan 14 15:49 .bashrc

-- vi .bashrc

-- add the following lines below.


# for jboss

export JAVA_HOME=/opt/SDK2/jdk

export PATH=$PATH:$JAVA_HOME/bin


export JBOSS_HOME=/opt/jBoss/jboss-5.1.0.GA

export PATH=$PATH:$JBOSS_HOME/bin


-- after saving the file ( source .bashrc)


4.)As root, type the following command at the shell prompt and you should see something like this:


[root@vsr ~]$ /usr/sbin/alternatives --config java

There are 2 programs which provide 'java'.

Selection Command

-----------------------------------------------

1 /usr/lib/jvm/jre-1.4.2-gcj/bin/java

*+ 2 /usr/lib/jvm/jre-1.5.0-sun/bin/java

Enter to keep the current selection[+], or type selection number:


[root@vsr ~]$ /usr/sbin/alternatives --config javac

There are 1 programs which provide 'javac'.

Selection Command

-----------------------------------------------

*+ 1 /usr/lib/jvm/java-1.5.0-sun/bin/javac

Enter to keep the current selection[+], or type selection number:


[root@vsr ~]$ /usr/sbin/alternatives --config java_sdk_1.5.0

There are 1 programs which provide 'java_sdk_1.5.0'.

Selection Command

-----------------------------------------------

*+ 1 /usr/lib/jvm/java-1.5.0-sun

Enter to keep the current selection[+], or type selection number:

[root@vsr ~]$ java -version

java version "1.5.0_14"

Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_14-b03)

Java HotSpot(TM) Client VM (build 1.5.0_14-b03, mixed mode, sharing)


INSTALLATION OF JBOSS (MANUAL INSTALLATION)

1.) Unzip the jboss-5.1.0.GA.zip

ex: unzip jboss-5.1.0.GA.zip

2.) create the directory under /opt
 
ex: mkdir /opt/jBoss

3.) Copy jboss folder to /opt/jBoss

4.) Run jboss application

-- Go to directory /opt/jBoss/jboss-5.1.0.GA/bin

-- type: ./run.sh -b 0.0.0.0 &


4.)Try to test your application.

    Try to access http://localhost:8080/

Apache and Php installation

Apache installation guide: version 2.0.63

Url: http://apache.opensourceresources.org/httpd/httpd-2.0.63
   
    -- extract http tar.gz

    -- tar xvf httpd-2.0.63.tar.gz

    -- cd httpd-2.0.63

    -- ./configure --prefix=/usr/local/apache2/  --enable-modules=so --enable-mods-shared='rewrite' --enable-'ssl' --with-'ssl'

    OR    

    ./configure --prefix=/usr/local/apache2/  --enable-modules=so --enable-module=rewrite --enable-ssl --with-ssl

    -- make

    -- make install
   
   
Php Installation guide: version 5.3.0

Url: http://www.php.net/get/php-5.3.0.tar.gz/from/au.php.net/mirror

    -- extract PHP tar.gz

    -- tar xvf php-5.3.0.tar.gz

    -- cd php-5.3.0

    -- ./configure' '--with-oci8=/dbdata/u01/app/oracle/product/9.2.0' '--with-mysql=/usr/bin/mysql' '--with-apxs2=/usr/local/apache2/bin/apxs' '--with-curl=/usr/bin' '--with-gd' '--with-zlib' '--with-jpeg-dir=/usr/lib' '--with-curl=/usr/bin/curl' '--with-openssl' '--with-mime-magic' '--with-pear=/usr/share/pear' '--enable-sigchild' '--with-freetype-dir=/usr/include/' '--enable-sockets' '--enable-mbstring=all'

    -- make

    -- make install
   
TO TEST THE PHP:
   
    -- Go to /home/user directory

    -- create public_html

    -- vim phpinfo.php 

    -- insert the following line

                  phpinfo()
          ?>

    -- Then save the file using :wq! then enter

    -- Go to (/home) type (chmod 775 -R then enter
        ex: chmod 775 ace -R

    -- In your firefox mozilla type this in address bar

       >> http:///~/phpinfo.php
       ex: http://192.168.8.19/~ace/phpinfo.php

    -- In test page you will see the version and logo of the php.
   
   




Monday, August 16, 2010

How to set up CRON

Cron A Linux process that performs background work, often at night) is set up by default on your RedHat system. So you don't have to do anything about it unless you would like to add some tasks to be performed on your system on a regular basis or change the time at which cron performs its duties.

Please note that some of the cron work might be essential for your system functioning properly over a long period of time. Among other things cron may:

*Rebuild the database of files which is used when you search for files with the locate command.
*Clean the /tmp directory.
*Rebuild the manual pages.
*Rotate" the log files, i.e. discard the oldest log files, rename the intermediate logs, and create new logs,
*Perform some other checkups, e.g. adding fonts that you recently copied to your system.

Therefore, it may not be the best idea to always switch your Linux machine off for the night--in such a case cron will never have a chance to do its job. If you do like switching off your computer for the night, you may want to adjust cron so it performs its duties at some other time.

To find out when cron wakes up to perform its duties, have a look at the file /etc/crontab, for example:

cat /etc/crontab

It may contain something like this:

# run-parts

01 * * * * root run-parts /etc/cron.hourly

02 4 * * * root run-parts /etc/cron.daily

22 4 * * 0 root run-parts /etc/cron.weekly

42 4 1 * * root run-parts /etc/cron.monthly

You can see that there are four categories of cron jobs: performed hourly, daily, weekly and monthly. You can modify those or add your own category. Here is how it works.

The columns in the entries show: minute (0-59), hour (0-23), day of month (1-31), month of year (1-12), day of week (0-6--Sunday to Saturday). The "*" means "any valid value".

Thus, in the example quoted, the hourly jobs are performed every time the computer clock shows "and one minute", which happens every hour, at one minute past the hour. The daily jobs are performed every time the clock shows 2 minutes past 4 o'clock, which happens once a day. The weekly jobs are performed at 22 minutes past four o'clock in the morning on Sundays. The monthly jobs are performed 42 minutes past four o'clock on the first day of every month. The directory with the script file that contain the command(s) to be executed is shown as the last entry on each line.

If you wanted your jobs to be performed at noon instead of 4 in the morning, just change the 4s to 12s. Cron wakes up every minute and examines if the /etc/crontab has changed so there is no need to re-start anything after you make your changes.

If you wanted to add a job to your cron, place a script which runs your job (or a link to your script) in the directory /etc/cron.hourly or cron.daily or /etc/cron.weekly, or /etc/cron.monthly .

Here is an example of an entry in /etc/crontab which causes a job to be performed three times a week (Mon, Wed, Fri):

02 4 * * 1,3,5 root run-parts/etc/cron.weekly

An example seen on usenet showing how to automatically email a log file (edited for space):

Re: help in crontab

From: Dean Thompson Date: 2001-03-03 16:35

Newsgroups: comp.os.linux.admin,comp.os.linux.networking,comp.os.linux.security

> How can I set the job mail abc@abc.com < /var/log

> every day in the /etc/crontab -e file ?

You could try the following entry and see if you meet with any success:

0 0 * * * (/bin/mail abc@abc.com < /var/log/messages) > /dev/null 2>&1