08-30-2005
You can check to see if any file has a particular file open using the lsof command.
lsof filename
produces no output if no process has that file open. If you're running on Solaris then you can also use the 'fuser' command in the same way.
Unfortunately these must both be run on the local server. So you must run them there or via 'trusted' rsh/ssh connections.
This User Gave Thanks to Unbeliever For This Post:
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi Friends,
I have to create a new log file everyday and append it with content based on some keywords found in another log file.
Here is what I have tried so far...
grep Error /parentfolder/someLogFile.log >> /parentfolder
/Archive/"testlogfile_error_`date '+%d%m%y'`.txt"
grep error... (6 Replies)
Discussion started by: supreet
6 Replies
2. Shell Programming and Scripting
Hi,
I need to create new directory by increasing the number by 1 of extracted lastly created directory.
e.g.
Log\out_log_1\
Log\out_log_2\
Log\out_log_3\
become
Log\out_log_1\
Log\out_log_2\
Log\out_log_3\
Log\out_log_4\
Can anyone help how to do it in c-shell... (3 Replies)
Discussion started by: Andre_2008
3 Replies
3. UNIX for Advanced & Expert Users
Hi all,
In linux how to create a directory with specified size, so that it can be used only up to the mentioned size.
Actually my question is, whether we can do directory quota in linux.
mounting the directory in a partiton will do that, but do we have any other option... (1 Reply)
Discussion started by: anishkumarv
1 Replies
4. UNIX for Dummies Questions & Answers
Hi,
I just forgot what command we can use to open a file, and then see its updates, I remember that there is an option -f ,but with what command :wall:
Tx
Trent (1 Reply)
Discussion started by: trento17
1 Replies
5. Solaris
hello,
i am an oracle DBA and trying to scan a newly created LUN of 200 GB on fiber channel by SAN admin.we have solaris 10 and SANtoolkit is installed.i tried following to get the new LUN at my machine. go /opt/Netapp/Santoolkit/bin and then ./sanlun lun show but i see only the existing... (12 Replies)
Discussion started by: janakors
12 Replies
6. Shell Programming and Scripting
hello everyone,
I am new to perl script and trying to develop a script as follows.
I am trying to Create an array for storing all file names. I am trying to copy $libs into "scratch". however i am unable to do so. Please suggest..
#!/usr/bin/perl
use File::Copy;
#use... (5 Replies)
Discussion started by: Rashid Khan
5 Replies
7. Hardware
Hi ,
I have created one new lun in my SAN storage and make it visible to my HP servers , but the fdisk -l output is somehow confusing. Do not know what to do next ----------
fdisk -l /dev/sdo1
Disk /dev/sdo1 (Sun disk label): 64 heads, 32 sectors, 10238 cylinders
Units =... (7 Replies)
Discussion started by: mishra.sankar
7 Replies
8. Shell Programming and Scripting
Hi All,
I'm trying to find a file which is created on current day.... I searched in unix.com and i found, below command.
find /land/ -mtime -1 -type f -print | grep "FF_Member_STG.dat"
The command checks if the file with name "FF_Member_STG.dat" is created today then exit else proceed.
... (3 Replies)
Discussion started by: ace_friends22
3 Replies
9. AIX
AIX 7.1
New to WPAR, hopefully just missing something simple here.
Creating the WPAR like this.....
(The box where the WPAR is hosted does have an iscsi protocol device)
mkwpar -h wpar08 -l -n wpar08 -N interface=en0 address=xxx.xx.xx.xxx netmask=255.255.255.0 -D devname=/dev/iscsi0 -D... (0 Replies)
Discussion started by: TomR
0 Replies
10. UNIX for Beginners Questions & Answers
Hello guys
thanks for this helpful forum.
I'm new to scripting and doing a little script that dump a sql database with some extra files from a VM of the company I'm in, and create a tar archive to be saved on our serve.
How can I have the tarball to be created with the files generated in the... (2 Replies)
Discussion started by: dquake
2 Replies
LEARN ABOUT DEBIAN
checkrestart
checkrestart(1) debian-goodies checkrestart(1)
NAME
checkrestart - check which processes need to be restarted after an upgrade
SYNOPSIS
checkrestart [ -hvpa ] [ -b blacklist_file ] [ -i package_name ]
DESCRIPTION
The checkrestart program tries to determine if there are processes in the system that need to be restarted after a system upgrade. This is
necessary since an upgrade will usually bring new system libraries and running processes will be still using the old versions of the
libraries. In stable Debian GNU/Linux systems this is typically needed to eliminate a system exposure to a vulnerability which might have
been fixed by upgrading a library which that process makes use of.
Consequently, checkrestart is sometimes used as an audit tool to find outdated versions of libraries in use, particularly after security
upgrades. Administrators should not, however, rely on its output completely (see BUGS below).
This script needs to run as root in order to obtain the information it needs for analysis.
OPTIONS
-h,--help
Show the program help and exit.
-v,--verbose
Generate detailed output. This output includes the list of all processes found using deleted files or descriptors as well as the
deleted files and descriptors found.
-p,--package
Only process deleted files that belong to a package, ignoring deleted files which do not have an associated package in the package
system.
-a,--all
Process all deleted files regardless of location. This makes the program analyse deleted files even if they would be discarded
because they are located in locations, such as /tmp , which are known to produce false positives. It will take preceded if used
simultaneously with the -p option.
-b file,--blacklist=file
Read a blacklist of regular expressions from file. Any files matching the patterns will be ignored.
-i name,--ignore=name
Ignore services that are associated to the package name provided in name.
EXIT STATUS
The program will exit with error (1) if a non-root user tries to run it. Otherwise, it will always exit with error status 0.
BUGS
This program might fail if the output of the lsof utility changes since it depends on it to detect which deleted files are used by pro-
cesses. It might also output some false positives depending on the processes' behaviour since it does not check yet if the (deleted) files
in use are really libraries.
If you find a false positive in checkrestart please provide the following information when submitting a bug report:
-- The output of checkrestart using the -v (verbose) option.
-- The output of running the following command as root:
lsof | egrep 'delete|DEL|path inode'
Checkrestart is also sensitive to the kernel version in use. And might fail to work with newer (or older) versions.
A rewrite to make it less dependent on lsof could improve this, however.
SEE ALSO
lsof(8)
AUTHOR
checkrestart was written by Matt Zimmerman for the Debian GNU/Linux distribution.
COPYRIGHT AND LICENCE
Copyright (C) 2001 Matt Zimmerman <mdz@debian.org> Copyright (C) 2007,2010-2011 Javier Fernandez-Sanguino <jfs@debian.org>
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option) any later version.
On Debian systems, a copy of the GNU General Public License may be found in /usr/share/common-licenses/GPL.
debian-goodies December 19 2006 checkrestart(1)