I have a shell script with 2 run time arguments. During the execution if i got any error, then it needs to redirected to a error file and in console. Also both error and output to be redirected to a log file.
Error output is getting copied to err file and getting displayed in console too. But in log file the output and error message it getting redirected twice. I am not willing to use set -x option.
I have a file, let's say 1.jpg, and I have a text file that contains a list of filenames I would like to duplicate 1.jpg as (i.e., 2.jpg, 3.jpg, 4.jpg, etc.). The filenames that I want to create are all on separate lines, one per line.
I'm sure there's a simple solution, but I'm not claiming to... (7 Replies)
i have many questions concerning the FD.
it was stated that "to redirect Error to output std, you have to write the following code"
# ls -alt FileNotThere File > logfile 2>&1
# cat logfile
ls: cannot access FileNotThere: No such file or directory
-rw-r--r-- 1 root root 0 2010-02-26... (9 Replies)
cat is the normal unix command to display the content of a file.
Is there any program to display the content of the file.
If there is, then can you send me the code. (5 Replies)
Hi Guys
I want to write a script which search mail with subject line and after that I want the mail content in a file
please help guys.
Thanks
Atul Singh (3 Replies)
To delete log files content older than 30 days and append the lastest date log file date in the respective logs
I want to write a shell script that deletes all log files content older than 30 days and append the lastest log file date in the respective logs
This is my script
cd... (2 Replies)
Hi All,
Below is my requirement.
I need to pick the certain content from log file and display. for example log file consist of following information
project1
project2
project3
filename1, size1, ower1, datecreated
filename2, size2, ower2, datecreated
filename3, size3, ower3,... (6 Replies)
Plese help I need a urgent requirement.
Ex: test.log
requirement : using shell script I need to archive the log file and nil and the content of (test.log) file to 0 kb
and then in the archive folder log files are name to test.tar
test1.tar
test2.tar
EX:
/home/abc/
test.log ... (1 Reply)
Hi all,
i have a logfile which is continuously being updated. I have built a script to check for a specific content and if it is found, it sends a string into a file. Here's the current script:
#!/bin/bash
logfile=/opt/jboss-eap-6.3/standalone/log/server.log
tail -fn0 $logfile | \... (7 Replies)
Discussion started by: nms
7 Replies
LEARN ABOUT LINUX
bootlogd
BOOTLOGD(8) Linux System Administrator's Manual BOOTLOGD(8)NAME
bootlogd - record boot messages
SYNOPSIS
/sbin/bootlogd [-c] [-d] [-r] [-s] [-v] [ -l logfile ] [ -p pidfile ]
DESCRIPTION
Bootlogd runs in the background and copies all strings sent to the /dev/console device to a logfile. If the logfile is not accessible, the
messages will be kept in memory until it is.
OPTIONS -d Do not fork and run in the background.
-c Attempt to write to the logfile even if it does not yet exist. Without this option, bootlogd will wait for the logfile to appear
before attempting to write to it. This behavior prevents bootlogd from creating logfiles under mount points.
-r If there is an existing logfile called logfile rename it to logfile~ unless logfile~ already exists.
-s Ensure that the data is written to the file after each line by calling fdatasync(3). This will slow down a fsck(8) process running
in parallel.
-v Show version.
-l logfile
Log to this logfile. The default is /var/log/boot.
-p pidfile
Put process-id in this file. The default is no pidfile.
BUGS
Bootlogd works by redirecting the console output from the console device. (Consequently bootlogd requires PTY support in the kernel con-
figuration.) It copies that output to the real console device and to a log file. There is no standard way of ascertaining the real con-
sole device if you have a new-style /dev/console device (major 5, minor 1) so bootlogd parses the kernel command line looking for con-
sole=... lines and deduces the real console device from that. If that syntax is ever changed by the kernel, or a console type is used that
bootlogd does not know about then bootlogd will not work.
AUTHOR
Miquel van Smoorenburg, miquels@cistron.nl
SEE ALSO dmesg(8),fdatasync(3).
Jul 21, 2003 BOOTLOGD(8)