| aug2000.tar |
Questions and Answers
Jim McKinstry
LOGDIR=/tmp/logs
LOG=logfile.log
DATE='whatever date command you want'
if test -d $LOGDIR
then
cd $LOGDIR
test -f $LOG && mv $LOG $LOG.0
cp /dev/null $LOG
chmod 644 $LOG
fi
2. Add the following to cron (this runs the newsyslog every day at 1:00 a.m.): 0 1 * * * /usr/lib/newsyslogIf your Solaris system does not have the newsyslog script and crontab entry to invoke it, create the newsyslog script manually and add the crontab entry for it.
1. Hard quotas prevent users from writing data to disk. With hard quotas, the utility automatically limits the users disk space for you, and no users are granted exceptions. Once users are about to reach their quota, they come to you for help. 2. Soft quotas send you alerts when users are about to exceed disk space. Unlike hard quotas, there is no physical restriction to prevent users from saving their data. However, you do get alerts and can create a corporate policy to help manage data.
1. stdin 0 Standard input to the program. 2. stdout 1 Standard output from the program. 3. stderr 2 Standard error output from the program.
Normally, input is from the keyboard or a file. Output, both stdout and stderr, normally goes to the terminal, but you can redirect one or both of these to one or more files. 2>&1 means take the standard error output from the program and send it to the same place that standard output is going. In addition to file redirection symbols, there are a number of other special symbols you can use on a command line. These include: ; Used to separate two commands on one line. & Run the command in the background. && Run the command following this only if the previous command completes successfully, (i.e., grep string file && cat file). || Run the command following only if the previous command did not complete successfully, (i.e., grep string file || echo "String not found"). ( ) The command within the parentheses is executed in a subshell. ' ' (forward single quote) Dont allow any special meaning to any characters within these quotations. \ Take the following character literally. Also used to escape a new-line character so you can continue a command on more than one line. " " Allow variable and command substitution with theses quotations. 'command' (back quote) Take the output of this command and substitute it as an argument on the command line. # Everything following until <newline> is a comment.
Typically, the first partition of your first IDE drive is /dev/hda1 (as seen by Linux). If thats your Windows C: drive, then do something like:
mkdir /windows_stuff mount -t vfat /dev/hda1 /windows_stuffor, to use what I said in the answer above this one:
mkdir /windows_stuff && \ mount -t vfat /dev/hda1 /windows_stuffAdd an entry to /etc/fstab to make this persistent across boots.
ps -ef | grep syslogdIf its not running, start it:
/usr/sbin/syslogdIf it is running, check that the file system that contains /var/adm/messages is not full (use df). If it is, clean it up and you should start getting messages again. Another reason for the system to not have any messages is that it is sending them somewhere else (another host or file). Messages go to another host if /ets/syslog.conf redirects them to loghost and you have a loghost entry in /etc/hosts or in your NIS map. Most systems define themselves as the loghost in /etc/hosts. Check /etc/hosts for the loghost entry. It should be the IP address of your host. On the other hand, if your system is configured to use NIS first, then the loghost file defined in NIS might determine where your messages are going. To check whether messages are going to another file, look in /etc/syslog.conf. If you dont see a line that sends messages to /var/adm/messages, then that might be the problem. n
About the Author
Jim McKinstry is a Senior Sales Engineer for MTI Technology Corporation (www.mti.com). MTI is a leading international provider of data storage management products and services. He can be reached at: jrmckins@yahoo.com.
|