Wednesday, January 2, 2008

unix_Latest

TCP Dump

- dump traffic on a network

- Tcpdump prints out the headers of packets on a network
interface that match the boolean expression
- Getting TCPdump to work on a UNIX system can be a chore. TCPdump must be able to put the interface (typically an Ethernet) into promiscuous mode to read all the network traffic. Currently supported systems include SunOS, Ultrix, and most BSDs. Linux is not supported, though there have been reports of a port.
- tcpdump [ -adeflnNOpqRStuvxX ] [ -c count ]
[ -C file_size ] [ -F file ]
[ -i interface ] [ -m module ] [ -r file ]
[ -s snaplen ] [ -T type ] [ -w file ]
[ -E algo:secret ] [ expression ]



netsat -rn

Shows routing information


Routing Table: IPv4
Destination Gateway Flags Ref Use Interface
-------------------- -------------------- ----- ----- ------ ---------
129.155.224.0 129.155.224.18 U 1 235606 ce1
10.21.0.0 10.21.0.10 U 1 677646 ce3
224.0.0.0 129.155.224.18 U 1 0 ce1
default 129.155.224.30 UG 1 233014
127.0.0.1 127.0.0.1 UH 6285962537 lo0


DTrace

Dynamic Tracing Framework

DTrace is a major new subsystem which has been integrated into Solaris 10. It gives you the ability to easily explore all of your system from the top of the application stack to the bowels of the kernel in an intuitive way. It allows you to generate concise answers to almost arbitrary questions giving you the ability to hone in on problem areas with extreme speed.

The main components of DTrace are the probe, the provider, the consumer and the D Programming Language.
Debugging tool we Use in SUN

Radiance
Device Path Decoder
Fatal-Reset Decoder
Sub-tool
Red State Exception Decoder
ASFR Decoder
Esyn Decoder for Enterprise Servers (E3000-E6500)


File System Commands

df -k (to check amount of space in mounted filesystem)

df -h (used as above but provides “human readable” size output – not available in older solaris)

df -oi (to check amount of inodes on a filesystem)

Unix directories and files don't really have names. They are numbered, using node numbers called inodes, vnodes, or even gnodes (depending on the version of Unix).

du -k (to check files on a filesystem)

du -h (Used as above, but provide human readable size output)

du -sh (to check amount of disk space used)



Virtual Memory

Virtual memory is an addressing scheme implemented in hardware and software that allows non-contiguous memory to be addressed as if it is contiguous. The technique used by all current implementations provides two major capabilities to the system:
1. Memory can be addressed that does not currently reside in main memory and the hardware and operating system will load the required memory from auxiliary storage automatically, without any knowledge of the program addressing the memory, thus allowing a program to reference more memory than actually exists in the computer.

2. In multi tasking systems, total memory isolation, otherwise referred to as a discrete address space, can be provided to every task except the lowest level operating system. This greatly increases reliability by isolating program problems within a specific task and allowing unrelated tasks to continue to process.






UNIX commands

top (shows processes running on the system and details about the process. Useful for degraded systems)

PID USERNAME THR PRI NICE SIZE RES STATE TIME CPU COMMAND
61803 sb153159 25 49 0 106M 105M sleep 145:04 1.41% jre
7652 kb207768 22 59 0 91M 91M sleep 88:28 1.16% jre
41467 rs162348 20 49 0 83M 82M sleep 7:19 0.73% jre
51473 rs162348 8 49 0 114M 103M sleep 10:29 0.46% mozilla-bin



ps (reports process status)

ps -ef ( shows current process running, often used with grep to look for a certain processes by process name or user name )

Syntax
ps [-a] [-A] [-c] [-d] [-e] [-f] [-j] [-l] [-L] [-P] [-y] [ -g grplist ] [ -n namelist ] [-o format ] [ -p proclist ] [ -s sidlist ] [ -t term] [ -u uidlist ] [ -U uidlist ] [ -G gidlist ]
-a
List information about all processes most frequently requested: all those except process group leaders and processes not associated with a terminal.
-A
List information for all processes. Identical to -e, below.
-c
Print information in a format that reflects scheduler properties as described in priocntl.The -c option affects the output of the -f and -l options, as described below.
-d
List information about all processes except session leaders.
-e
List information about every process now running.
-f
Generate a full listing.
-j
Print session ID and process group ID.
-l
Generate a long listing.
-L
Print information about each light weight process (lwp) in each selected process.
-P
Print the number of the processor to which the process or lwp is bound, if any, under an additional column header, PSR.
-y
Under a long listing (-l), omit the obsolete F and ADDR columns and include an RSS column to report the resident set size of the process. Under the -y option, both RSS and SZ will be reported in units of kilobytes instead of pages.
-g grplist
List only process data whose group leader's ID number(s) appears in grplist. (A group leader is a process whose process ID number is identical to its process group ID number.)
-n namelist
Specify the name of an alternative system namelist file in place of the default. This option is accepted for compatibility, but is ignored.
-o format
Print information according to the format specification given in format. This is fully described in DISPLAY FORMATS. Multiple -o options can be specified; the format specification will be interpreted as the space-character-separated concatenation of all the format option-arguments.
-p proclist
List only process data whose process ID numbers are given in proclist.
-s sidlist
List information on all session leaders whose IDs appear in sidlist.
-t term
List only process data associated with term. Terminal identifiers are specified as a device file name, and an identifier. For example, term/a, or pts/0.
-u uidlist
List only process data whose effective user ID number or login name is given in uidlist. In the listing, the numerical user ID will be printed unless you give the -f option, which prints the login name.
-U uidlist
List information for processes whose real user ID numbers or login names are given in uidlist. The uidlist must be a single argument in the form of a blank- or comma-separated list.
-G gidlist
List information for processes whose real group ID numbers are given in gidlist. The gidlist must be a single argument in the form of a blank- or comma-separated list.
Examples
ps
Typing ps alone would list the current running processes. Below is an example of the output that would be generated by the ps command.
PID TTY TIME CMD6874 pts/9 0:00 ksh6877 pts/9 0:01 csh418 pts/9 0:00 csh
ps -ef
Display full information about each of the processes currently running.
UID PID PPID C STIME TTY TIME CMDhope 29197 18961 0 Sep27 ? 00:00:06 sshd: hope@pts/87hope 32097 29197 0 Sep27 pts/87 00:00:00 -cshhope 7209 32097 0 12:17 pts/87 00:00:00 ps -ef

kill (terminate or signal processes)
kill -N PID, where N is a signal number and PID is the Process Identification Number

Signal number 1, a hangup signal, is recommended because it should kill the process and, if it is an editor, save the buffer. This is the default if you do not specify a signal number. Signal number 9, a kill signal, is the surest way to kill a process and is recommended only as a last resort since it will not save editor buffers.
The interrupt and quit (keystroke) signals mentioned above can be sent to a process by replacing N with 2 and 3, respectively. There are many different signals that can be sent to a process via kill. Each of them conveys slightly different information but generally causes death, whence the name of the command.


xkill (kills a gui window and all of its children)


cal
This command will print a calendar for a specified month and/or year.
To show this month's calendar, enter:
cal
To show a twelve-month calendar for 2004, enter:
cal 2004
To show a calendar for just the month of June, 1970, enter:
cal 6 1970

cat
This command outputs the contents of a text file. You can use it to read brief files or to concatenate files together.
To append file1 onto the end of file2, enter:
cat file1 >> file2
To view the contents of a file named myfile, enter:
cat myfile
Because cat displays text without pausing, its output may quickly scroll off your screen. Use the less command (described below) or an editor for reading longer text files.

cd
This command changes your current directory location. By default, your Unix login session begins in your home directory.
To switch to a subdirectory (of the current directory) named myfiles, enter:
cd myfiles
To switch to a directory named /home/dvader/empire_docs, enter:
cd /home/dvader/empire_docs
To move to the parent directory of the current directory, enter:
cd ..
To move to the root directory, enter:
cd /
To return to your home directory, enter:
cd
chmod
This command changes the permission information associated with a file. Every file (including directories, which Unix treats as files) on a Unix system is stored with records indicating who has permission to read, write, or execute the file, abbreviated as r, w, and x. These permissions are broken down for three categories of user: first, the owner of the file; second, a group with which both the user and the file may be associated; and third, all other users. These categories are abbreviated as u for owner (or user), g for group, and o for other.
To allow yourself to execute a file that you own named myfile, enter:
chmod u+x myfile
To allow anyone who has access to the directory in which myfile is stored to read or execute myfile, enter:
chmod o+rx myfile
You can view the permission settings of a file using the ls command, described below.
Note: Be careful with the chmod command. If you tamper with the directory permissions of your home directory, for example, you could lock yourself out or allow others unrestricted access to your account and its contents.

cp
This command copies a file, preserving the original and creating an identical copy. If you already have a file with the new name, cp will overwrite and destroy the duplicate. For this reason, it's safest to always add -i after the cp command, to force the system to ask for your approval before it destroys any files. The general syntax for cp is:
cp -i oldfile newfile
To copy a file named meeting1 in the directory /home/dvader/notes to your current directory, enter:
cp -i /home/dvader/notes/meeting1 .
The . (period) indicates the current directory as destination, and the -i ensures that if there is another file named meeting1 in the current directory, you will not overwrite it by accident.
To copy a file named oldfile in the current directory to the new name newfile in the mystuff subdirectory of your home directory, enter:
cp -i oldfile ~/mystuff/newfile
The ~ character (tilde) is interpreted as the path of your home directory.
Note: You must have permission to read a file in order to copy it.
df
This command reports file system disk usage, (i.e., the amount of space taken up on mounted file systems). For each mounted file system, df reports the file system device, the number of blocks used, the number of blocks available, and the directory where the file system is mounted.
To find out how much disk space is used on each file system, enter the following command:
df
If the df command is not configured to show blocks in kilobytes by default, you can issue the following command:
df -k

du
This command reports disk usage (i.e., the amount of space taken up by a group of files). The du command descends all subdirectories from the directory in which you enter the command, reporting the size of their contents, and finally reporting a total size for all the files it finds.
To find out how much disk space your files take up, switch to your home directory with the cd command, and enter:
du
The numbers reported are the sizes of the files; on different systems, these sizes will be in units of either 512 byte blocks or kilobytes. To learn which is the case, use the man command, described below. On most systems, du -k will give sizes in kilobytes.
find
The find command lists all of the files within a directory and its subdirectories that match a set of conditions. This command is most commonly used to find all of the files that have a certain name.
To find all of the files named myfile.txt in your current directory and all of its subdirectories, enter:
find . -name myfile.txt -print
To look in your current directory and its subdirectories for all of the files that end in the extension .txt, enter:
find . -name "*.txt" -print
In these examples, the . (period) represents your current directory. It can be replaced by the full pathname of another directory to search. For instance, to search for files named myfile.txt in the directory /home/user/myusername and its subdirectories, enter:
find /home/user/myusername/ -name myfile.txt -print
On some systems, omitting the final / (slash) after the directory name can cause find to fail to return any results.
As a shortcut for searching in your home directory, enter:
find "$HOME/" -name myfile.txt -print

jobs
This command reports any programs that you suspended and still have running or waiting in the background (if you had pressed Ctrl-z to suspend an editing session, for example). For a list of suspended jobs, enter:
jobs
Each job will be listed with a number; to resume a job, enter % (percent sign) followed by the number of the job. To restart job number two, for example, enter:
%2
This command is only available in the csh, bash, tcsh, and ksh shells.
kill
Use this command as a last resort to destroy any jobs or programs that you suspended and are unable to restart. Use the jobs command to see a list of suspended jobs. To kill suspended job number three, for example, enter:
kill %3
Now check the jobs command again. If the job has not been cancelled, harsher measures may be necessary. Enter:
kill -9 %3
less and more
Both less and more display the contents of a file one screen at a time, waiting for you to press the Spacebar between screens. This lets you read text without it scrolling quickly off your screen. The less utility is generally more flexible and powerful than more, but more is available on all Unix systems while less may not be.
To read the contents of a file named textfile in the current directory, enter:
less textfile
The less utility is often used for reading the output of other commands. For example, to read the output of the ls command one screen at a time, enter:
ls -la less
In both examples, you could substitute more for less with similar results. To exit either less or more, press q. To exit less after viewing the file, press q.
Note: Do not use less or more with executables (binary files), such as output files produced by compilers. Doing so will display garbage and may lock up your terminal.
lpr and lp
These commands print a file on a printer connected to the computer network. The lpr command is used on BSD systems, and the lp command is used in System V. Both commands may be used on the UITS systems.
To print a file named myfile on a printer named lp1 with lpr, enter:
lpr -Plp1 myfile
To print the same file to the same printer with lp, enter:
lp -dlp1 myfile
Note: Do not print to a printer whose name or location is unfamiliar to you.

ls
This command will list the files stored in a directory. To see a brief, multi-column list of the files in the current directory, enter:
ls
To also see "dot" files (configuration files that begin with a period, such as .login), enter:
ls -a
To see the file permissions, owners, and sizes of all files, enter:
ls -la
If the listing is long and scrolls off your screen before you can read it, combine ls with the less utility, for example:
ls -la less

man
This command displays the manual page for a particular command. If you are unsure how to use a command or want to find out all its options, you might want to try using man to view the manual page.
For example, to learn more about the ls command, enter:
man ls
To learn more about man, enter:
man man
If you are not sure of the exact command name, you can use man with the -k option to help you find the command you need. To see one line summaries of each reference page that contains the keyword you specify, enter:
man -k keyword

mkdir
This command will make a new subdirectory.
To create a subdirectory named mystuff in the current directory, enter:
mkdir mystuff
To create a subdirectory named morestuff in the existing directory named /tmp, enter:
mkdir /tmp/morestuff
Note: To make a subdirectory in a particular directory, you must have permission to write to that directory.

mv
This command will move a file. You can use mv not only to change the directory location of a file, but also to rename files. Unlike the cp command, mv will not preserve the original file.
Note: As with the cp command, you should always use -i to make sure you do not overwrite an existing file.
To rename a file named oldname in the current directory to the new name newname, enter:
mv -i oldname newname
To move a file named hw1 from a subdirectory named newhw to another subdirectory named oldhw (both subdirectories of the current directory), enter:
mv -i newhw/hw1 oldhw
If, in this last operation, you also wanted to give the file a new name, such as firsthw, you would enter:
mv -i newhw/hw1 oldhw/firsthw
ps
The ps command displays information about programs (i.e., processes) that are currently running. Entered without arguments, it lists basic information about interactive processes you own. However, it also has many options for determining what processes to display, as well as the amount of information about each. Like lp and lpr, the options available differ between BSD and System V implementations. For example, to view detailed information about all running processes, in a BSD system, you would use ps with the following arguments:
ps -alxww
To display similar information in System V, use the arguments:
ps -elf
For more information about ps refer to the ps man page on your system. Also see the Knowledge Base document In Unix, what do the output fields of the ps command mean?
pwd
This command reports the current directory path. Enter the command by itself:
pwd

rm
This command will remove (destroy) a file. You should enter this command with the -i option, so that you'll be asked to confirm each file deletion. To remove a file named junk, enter:
rm -i junk
Note: Using rm will remove a file permanently, so be sure you really want to delete a file before you use rm.
To remove a non-empty subdirectory, rm accepts the -r option. On most systems this will prompt you to confirm the removal of each file. This behavior can be prevented by adding the -f option. To remove an entire subdirectory named oldstuff and all of its contents, enter:
rm -rf oldstuff
Note: Using this command will cause rm to descend into each subdirectory within the specified subdirectory and remove all files without prompting you. Use this command with caution, as it is very easy to accidently delete important files. As a precaution, use the ls command to list the files within the subdirectory you wish to remove. To browse through a subdirectory named oldstuff, enter:
ls -R oldstuff less

rmdir
This command will remove a subdirectory. To remove a subdirectory named oldstuff, enter:
rmdir oldstuff
Note: The directory you specify for removal must be empty. To clean it out, switch to the directory and use the ls and rm commands to inspect and delete files.
set
This command displays or changes various settings and options associated with your Unix session.
To see the status of all settings, enter the command without options:
set
If the output scrolls off your screen, combine set with less:
set less
The syntax used for changing settings is different for the various kinds of Unix shells; see the man entries for set and the references listed at the end of this document for more information.
vi
This command starts the vi text editor. To edit a file named myfile in the current directory, enter:
vi myfile
The vi editor works fairly differently from other text editors. If you have not used it before, you should probably look at a tutorial, such as the Knowledge Base document How do I use the vi text editor? Another helpful document for getting started with vi is A quick reference list of vi editor commands.
The very least you need to know to start using vi is that in order to enter text, you need to switch the program from command mode to insert mode by pressing i. To navigate around the document with the cursor keys, you must switch back to command mode by pressing Esc. To execute any of the following commands, you must switch from command mode to ex mode by pressing : (the colon key): Enter w to save; wq to save and quit; q! to quit without saving.
w and who
The w and who commands are similar programs that list all users logged into the computer. If you use w, you also get a list of what they are doing. If you use who, you also get the IP numbers or computer names of the terminals they are using.

SORT- sorts ASCII files

The three most important options of Unix soft are -n (numeric keys sorting), +n (sorting using n-th field, counting from zero) and -r (sort in reverse).



Sed

Sed is the ultimate stream editor. If that sounds strange, picture a stream flowing through a pipe

AWK

awk is a programming language designed to search for, match patterns, and perform actions on files. awk programs are generally quite small, and are interpreted. This makes it a good language for prototyping.

awk scans input lines one after the other, searching each line to see if it matches a set of patterns or conditions specified in the awk program.
For each pattern, an action is specified. The action is performed when the pattern matches that of the input line.
Thus, an awk program consists of a number of patterns and associated actions. Actions are enclosed using curly braces, and separated using semi-colons.

pattern { action }
pattern { action }

what is the use of /log or /bin or /usr folder?

The directory structure of a typical UNIX system is
/ root directory
/bin Unix utilities
/dev special devices
/etc administrative programs and tables
/lib language libraries
/tmp temporary files
/usr user sub-directory area
/usr/bin Unix utilities
/usr/include include files used by language processors
/usr/lib archive libraries, text processing macros
/usr/news news
/usr/spool spool files for printing
/usr/tmp temporary files
AFS:

AFS is a distributed file system. It uses the client/server model,
where all the files are stored on file server machines. Files are
transferred to client machines as necessary and cached on local disk.
The server part of AFS is called the AFS File Server, and the client
part of AFS is called the AFS Cache Manager. AFS provides Access
Control Lists (ACLs) which provide for more control and flexibility
than standard UNIX file permissions.




Ps not found

Refresh path variable in pre and post scripts, so you can use all the unix commands
export PATH=$PATH:/usr/bin:/usr/sbin/


Extended Post

An extended boot is also know as a diagnostic boot.

You go to the OBP also known as the OK> prompt and change some variables
to do extended diagnostics when the system reboots.

At the OK> prompt you need to do the following commands:

setenv diag-level max
setenv diag-switch? true
setenv auto-boot? false
Some people will do the commmand reset-all at this point.

Or you can use the command
power-off


Diamond Operator (<>) in Perl

Another way to read input is with the diamond operator: <>. This works like in that it returns a single line in a scalar context (undef if all the lines have been read) or all remaining lines if used in a list context. However, unlike , the diamond operator gets its data from the file or files specified on the command line that invoked the Perl program. For example, you have a program named kitty, consisting of
#!/usr/bin/perl
while (<>) {
print $_;
}
and you invoke kitty with
kitty file1 file2 file3
then the diamond operator reads each line of file1 followed by each line of file2 and file3 in turn, returning undef only when all of the lines have been read. As you can see, kitty works a little like the UNIX command cat, sending all the lines of the named files to standard output in sequence. If, like cat, you don't specify any filenames on the command line, the diamond operator reads from standard input automatically.
Technically, the diamond operator isn't looking literally at the command-line arguments; it works from the @ARGV array. This array is a special array initialized by the Perl interpreter to the command-line arguments. Each command-line argument goes into a separate element of the @ARGV array. You can interpret this list any way you want.[2] You can even set this array within your program and have the diamond operator work on that new list rather than the command-line arguments, like so:
@ARGV = ("aaa","bbb","ccc");
while (<>) { # process files aaa, bbb, and ccc
print "this line is: $_";
}


JAVA

What is Object-oriented programming



A type of programming in which programmers define not only the data type of a data structure, but also the types of operations (functions) that can be applied to the data structure. In this way, the data structure becomes an object that includes both data and functions. In addition, programmers can create relationships between one object and another. For example, objects can inherit characteristics from other objects.
One of the principal advantages of object-oriented programming techniques over procedural programming techniques is that they enable programmers to create modules that do not need to be changed when a new type of object is added. A programmer can simply create a new object that inherits many of its features from existing objects. This makes object-oriented programs easier to modify.
To perform object-oriented programming, one needs an object-oriented programming language (OOPL). Java, C++ and Smalltalk are three of the more popular languages, and there are also object-oriented versions of Pascal.

What's the difference between the methods sleep() and wait()
A. The code sleep(1000); puts thread aside for exactly one second. The code wait(1000), causes a wait of up to one second. A thread could stop waiting earlier if it receives the notify() or notifyAll() call. The method wait() is defined in the class Object and the method sleep() is defined in the class Thread.





SQL Questions

Select - extracts data from a database table
Select LastName, FirstName from PERSONS
To check the content of a table: SELECT * from TableName

Join – Joins two tables with a common factor
Insert Into - inserts new data into a database table
INSERT INTO Persons
VALUES ('Hetland', 'Camilla', 'Hagabakka 24', 'Sandnes')
Delete - deletes rows from a database table

DELETE FROM table_name
WHERE column_name = some_value

DELETE from PERSONS where LastName = 'Nina'

Update - updates data in a database table
UPDATE table_name
SET column_name = new_value
WHERE column_name = some_value
UPDATE Person SET FirstName = 'Nina'
WHERE LastName = 'Rasmussen'
ORDER BY - The ORDER BY clause is used to sort the rows.
SELECT Company, OrderNumber FROM Orders
ORDER BY Company
MAX function - The MAX function returns the maximum value of an expression.
For example, you might wish to know the maximum salary of all employees.
SELECT MAX(salary) as "Highest salary" FROM employees;
CREATE TABLE - creates a new database table
CREATE TABLE table_name
(
column_name1 data_type,
column_name2 data_type,
.......
)


· ALTER TABLE - alters (changes) a database table
· DROP TABLE - deletes a database table
· CREATE INDEX - creates an index (search key)
· DROP INDEX- deletes an index

probe-scsi-all

The probe-scsi-all is a bootprom command that is not available in the Solaris operating enviroment. To use it, you must be at the ok prompt. To access this prompt, you must be consoled into the computer through a serial interface or the RSC (remote system control) card, if present.

Steps:
os# Sync; sync; init 0
ok> setenv auto-boot? False
ok> reset-all
ok> probe-scsi-all

The output of this command will show you all of the SCSI devices that the host system can see and their device paths, for example: /pci@1f,2000/scsi@1 Target 0 Unit 0 Removable Tape QUANTUM DLT7000 2150 Target 1 Unit 0 Removable Device type 8 HP C6280-7000 2.00 Before you reboot your system, you must reset the auto-boot? variable to true:

NETCOOL

Netcool/Impact is a set of runnable server components that work together to provide event management and integration functionality for the Netcool suite of products.
From a software perspective, you can best understand Netcool/Impact as a set of interrelated, runnable server components, each of which must be installed and configured separately. These components are:
· Netcool/Impact Server
· Netcool Security Manager
· Netcool GUI Server
· Netcool Common License Server



AutoSys

AutoSys is an application by Computer Associates that is used in large Enterprises for cross platform job scheduling.
AutoSys is a full job scheduling and management system for NT systems. AutoSys lets you create simple or complex sets of instructions to automatically execute at regular intervals. AutoSys lets you trigger jobs by date and time, file arrival, and other criteria. If you decide to use AutoSys in a UNIX environment, it has a feature that lets you automatically convert cron job files for use on AutoSys.
Like a mainframe scheduling product, AutoSys automatically monitors your jobs. If necessary, AutoSys can automatically restart jobs that have failed, were cancelled, or were aborted for a variety of reasons. For mission critical enterprise environments, AutoSys also has a high availability option that will perform an unattended rollover to a backup server if your primary server fails.
To check Job status
Autorep –J jobname
To check history
Jobrunhist –J jobname

AutoSys: UNIX
Cd to the "autouser" ($AUTOUSER) directory and "." (or source) the "ksh" file. Ex: ". ./autosys.ksh.machine" After installing AutoSys, first make sure that the DB is up and running. Check the installation by running the command chk_auto_up to verify connection to the DB and event processor.
Enter the KEYS through "gatekeeper", add keys
Run the "autosys_secure" command to set the AutoSys Edit and Exec Super users (and also to enter NT users/passwords)
Start the Event Processor by running the command "eventor"
Shutdown AutoSys: "sendevent -E STOP_DEMON"
To start the AutoSys GUI set your DISPLAY and run the command "autosc &".
NT: Start AutoSys from start->programs->AutoSys-> administrator ->Graphical User Interface ->Command Prompt
Command Line Commands:
gatekeeper: Allows you to enter the License Keys which allow you to run AutoSys.
eventor [-M machine_name] : Starts the event processor.
autorep -J [ALL Job_name] [-q] [> file_name], -d (detail), -r (run number), -o (override), jil <> file_name queries the DB & save job Dfn. Into a file vi file_name When you want a report of a box use the -L0 option Autorep -J job_name -l1 report on the job for the day -1 (prev day)
sendevent -E STARTJOB -J job_name, sendevent -E FORCE_STARTJOB -J job_name, [JOB_ON_ICE, JOB_OFF_ICE, JOB_ON_HOLD, JOB_OFF_HOLD, SET_GLOBAL, STOP_DEMON. . . .] sendevent -E STOP_DEMON - to stop AutoSys (ex: sendevent -E SET_GLOBAL -G "var_name=/home/mydir" to set a var) (ex: sendevent -E SET_GLOBAL -G "var_name=DELETE" to delete a var)]
chk_auto_up: checks to see if event processor and the DB are both up.
autoping -m machine: verify that both client & server are correctly configured.
cron2jil -f cronfile [-d outdir] [-I incl_file] [-m machine] [-p prefix]
jil To insert a job directly into the DBinsert_job: job.id job_type: cmachine: machine_namecommand: echo testing jil[go ;] (depending on the DB you are using)Template example:
/* ----------------- template ----------------- */
insert_job: template job_type: c box_name: box1command: ls -lmachine: localhostowner: lyota01@TANT-A01permission: gx,ge,wx,we,mx,medate_conditions: 1days_of_week: allstart_times: "15:00, 14:00"run_window: "14:00 - 6:00"condition: s (job1)description: "description field"n_retrys: 12term_run_time: 60box_terminator: 1job_terminator: 1std_out_file: /tmp/std_outstd_err_file: /tmp/std_errmin_run_alarm: 5max_run_alarm: 10alarm_if_fail: 1max_exit_success: 2chk_files: /tmp 2000profile: /tmp/.profilejob_load: 25priority: 1auto_delete: 12
autosyslog -e: same as tail -f autosys_log_file. This command must be run from the machine where the server resides if used with the -e option. Else it can be used with the -J option to see that job's run log.
job_depends: -[cdt] -J jobname [-F "mm/dd/yy time"] [-T "mm/dd/yy time"] (Note: It will only print out the first occurrence found)
monbro -n monitor_name: Allows you to run from command line monitor/browser programs previously created using the monitor/browser GUI.exec superuser: AUTOSYS superuser
autocal_asc full_cal_name: prints, adds & deletes custom calendar definitions.
autostatus: Reports the current status of a specific job, or the value of an AutoSys global variable. Ex: autostatus -J job_name, -S instance
autotimezone -l : Allows additions, deletions, and queries to the timezones table (-l provides list).
autotrack: Tracks & report changes to the AutoSys DB. Ex: autotrack -l 2 (level 2) [sets the tracking level] autotrack -U sys -v (user sys: verbose) To start using the autotrack utility type: autotrack -u to set tracking level 1 or 2. By default it is set to 0. Autotrack -l will list the current tracking level. Options -[J, U, m, F, T, and t] are to request reporting on a specific Job, User, machine, time window (-F -T), and event type (t). Type is used in conjunction w/other parameters. autotrack w/no arguments retrieves information an all events omitting detail. -v option is for verbose.
autosys_secure: to change edit, exec superusers, change DB passwd, change remote authentication method.
chase [-AE]: Makes sure that jobs claiming to be running in the client machine are running. The "-E" option restarts the job.
archive_events: to archive events in the DB which are older than x days to prev DB from becoming full.
clean_files: Deletes old remote agent log files. It does it by searching the DB for all machines which have had jobs started on them.
autostatad: to get the status of a PeopleSoft job. You can define one of the user definable buttons to view PeopleSoft job: Autocons*userButton1Label: Adapter Status

Crontab –L, crontab –E, how to change the crontab

The shell is a program that interprets commands and acts as an intermediary between the user and the inner workings of the Unix system
Shell
Class
Description
Korn shell (ksh)
sh
An extension of the Bourne shell with several features adapted from the C shell; the POSIX shell is based on the Korn shell
TC shell (tcsh)
csh
A revision of the C shell with substantially expanded capabilities; the default shell in modern BSD implementations, including Mac OS X/Darwin
Bourne-again shell (bash)
sh
An extension of the Bourne shell, but with unique features; part of the GNU project and the default shell for Linux

Informatica
Informatica can communicate with all major databases, can move/transform data between them. It can move huge volumes of data in a very effective way. It can throttle the transactions (do big updates in small chunks to avoid long locking and filling the transactional log). It can effectively do joins between tables in different databases on different servers. The tasks are performed by Informatica Server (Unix or MS Windows). You get a client application called "Server Manager" to work with the server.
You design your processes in a client application called "Designer". This is where you you tell what the source databases and tables will be, what will be the targets, and how you move/transform the data.
Informatica uses its own database called "Metadata Repository Database", or simply a Repository. Repository stores the data (rules) needed for data extraction, transformation, loading, and management. You get a client application "Repository Manager" to work with the repository.


cron is a unix, solaris utility that allows tasks to be automatically run in the background at regular intervals by the cron daemon (=comput a piece of software that carries out background tasks such as filtering or debugging, at fixed intervals or in response to specific events). These tasks are often termed as cron jobs in unix , solaris. Crontab (CRON TABle) is a file which contains the schedule of cron entries to be run and at specified times.

crontab -a filename
Install filename as your crontab file. On many systems, this command is executed simply as crontab filename (i.e., without the -a option).
crontab -e
Edit your crontab file, or create one if it doesn't already exist.
crontab -l
Display your crontab file.
crontab -r
Remove your crontab file.
crontab -v
Displays the last time you edited your crontab file. (This option is only available on a few systems.)
crontab -u user
Used in conjunction with other options, modify or view the crontab file of user. When available, this option can only be used by administrators.

. Crontab Restrictions____________You can execute crontab if your name appears in the file /usr/lib/cron/cron.allow. If that file does not exist, you can usecrontab if your name does not appear in the file /usr/lib/cron/cron.deny. If only cron.deny exists and is empty, all users can use crontab. If neither file exists, only the root user can use crontab. The allow/deny files consist of one user name per line.

Crontab file___________Crontab syntax :-A crontab file has five fields for specifying day , date and time followed by the command to be run at that interval.
* * * * * command to be executed- - - - - +----- day of week (0 - 6) (Sunday=0) +------- month (1 - 12) +--------- day of month (1 - 31) +----------- hour (0 - 23)+------------- min (0 - 59)
* in the value field above means all legal values as in braces for that column. The value column can have a * or a list of elements separated by commas. An element is either a number in the ranges shown above or two numbers in the range separated by a hyphen (meaning an inclusive range). Note: The specification of days can be made in two fields: month day and weekday. If both are specified in an entry, they are cumulative meaning both of the entries will get executed .
4. Crontab Example_______A line in crontab file like below removes the tmp files from /home/someuser/tmp each day at 6:30 PM.
30 18 * * * rm /home/someuser/tmp/*
Changing the parameter values as below will cause this command to run at different time schedule below :
min
hour
day/month
month
day/week
Execution time
30
0
1
1,6,12
*
-- 00:30 Hrs on 1st of Jan, June & Dec.
:
0
20
*
10
1-5
--8.00 PM every weekday (Mon-Fri) only in Oct.
:
0
0
1,10,15
*
*
-- midnight on 1st ,10th & 15th of month
:
5,10
0
10
*
1
-- At 12.05,12.10 every Monday & on 10th of every month
:
Note : If you inadvertently enter the crontab command with no argument(s), do not attempt to get out with Control-d. This removes all entries in your crontab file. Instead, exit with Control-c.
5. Crontab Environment___________cron invokes the command from the user's HOME directory with the shell, (/usr/bin/sh). cron supplies a default environment for every shell, defining:HOME=user's-home-directoryLOGNAME=user's-login-idPATH=/usr/bin:/usr/sbin:.SHELL=/usr/bin/shUsers who desire to have their .profile executed must explicitly do so in the crontab entry or in a script called by the entry.6. Disable Email____________
By default cron jobs sends a email to the user account executing the cronjob. If this is not needed put the following command At the end of the cron job line .>/dev/null 2>&1
7. Generate log file________________
To collect the cron execution execution log in a file :30 18 * * * rm /home/someuser/tmp/* > /home/someuser/cronlogs/clean_tmp_dir.log

No comments: