Sponsored Content
Full Discussion: orphan soft linked files
Special Forums UNIX Desktop Questions & Answers orphan soft linked files Post 302342189 by TonyFullerMalv on Friday 7th of August 2009 06:20:42 PM
Old 08-07-2009
Having made a symbolic link to a non-existant file:
Code:
$ ls -l /tmp/fred /fred
ls: cannot access /fred: No such file or directory
lrwxrwxrwx 1 tony tony 5 2009-08-07 23:03 /tmp/fred -> /fred
$

Try to list the file the link points to:
Code:
$ ls -lL /tmp/fred
ls: cannot access /tmp/fred: No such file or directory
$ echo $?
2
$

Combine that with a:
Code:
find -type l

To find all the symbolic links and you have a method of locating broken symbolic links.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script to kill stranded/orphan process by users.

I have customers on our AIX/UNIX node startup a process that becomes stranded or orphaned and must be killed. I would like to create a script to check for these orphan processes and kill them. I can have cron run this job. The customers process will run and after 24 hours time out leaving an... (4 Replies)
Discussion started by: rjohnson
4 Replies

2. UNIX for Advanced & Expert Users

rdist -- but not linked files

How do I rdist a directory from one server to another, excluding soft and hard links? current rdist syntax: 1 2 * * * cd /apps/oasis/prdsch/log; rdist -c j1*.log oasis@oastdby:/apps/schiller/oasis/prdsch/log 31 2 * * * cd /apps/oasis/prdsch/log; rdist -c oasis_bin_trans*.log... (6 Replies)
Discussion started by: captainzeb
6 Replies

3. UNIX for Advanced & Expert Users

Files Linked With A Binary

Hi, What is command in unix to find what are all the files linked with an executable binary. Thanks in advance. Rgds, Omkumar (2 Replies)
Discussion started by: tc.omkumar
2 Replies

4. UNIX for Advanced & Expert Users

how to remove db2 orphan processes

Hi Guys, I'm working on a AIX 5.3 environment and I've been quite a few times in a situation where we can remove db2 orphan processes therefore our only alternative has been to reboot the entire server. Now I wonder is there is any other possible way that we can use to remove those processes... (5 Replies)
Discussion started by: hariza
5 Replies

5. Linux

Cron ORPHAN (no passwd entry)

I am using the standard vixie-cron am seeing the following my logs : crond: (username) ORPHAN (no passwd entry) Ordinarily this is a simple matter, there is no corresponding user, but I am using central authentication and the username does exist and is usable via the standard nsswitch mechanism, so... (2 Replies)
Discussion started by: humbletech99
2 Replies

6. Shell Programming and Scripting

How to retrieve all the linked script files/ctl files/sql files?

Hi I am going to migrate our datawarehouse system from HP Tru 64 Unix to the Red Hat Linux. Inside the box, it is running around 40 cron jobs; inside each cron job, it is calling other shell script files, and the shell script files may again call other shell script files or ctl files(for... (1 Reply)
Discussion started by: franksubramania
1 Replies

7. Shell Programming and Scripting

Mailing me the Defunct/Zombie/Orphan

Hello I need a script which would mail me the list of processes which are zombie/defunct or orphan. Please help me in this regard. (7 Replies)
Discussion started by: mehimadri
7 Replies

8. UNIX for Dummies Questions & Answers

List linked files

A perl script that displays the list of files which have multiple links..! ls -l shows number of links in a field. (0 Replies)
Discussion started by: aadi_uni
0 Replies

9. UNIX for Advanced & Expert Users

cronjobs orphan processes

Our cron job stats its started on Oct20 % ps -ef | grep cron root 1442044 1 0 Oct 20 - 25:23 /usr/sbin/cron All the below jobs aixmf,aixgh are triggered from cron only. user pid ppid date time cmd gaix 1581282 1 35 16:33:01 - 20:56... (1 Reply)
Discussion started by: karnan
1 Replies

10. UNIX for Beginners Questions & Answers

Is orphan process handling by Solaris os and Linux os same?

In solaris, orphan process is put to sleep mode and does not consume any CPU resources. In Linux, orphan process is kept in running state consuming all CPU and Ram resources. Is it the case? Is there a difference on how these operating systems will handle orphan processes? The route cause of... (10 Replies)
Discussion started by: Belure Pooja B
10 Replies
media_findname(3VOLMGT) 				Volume Management Library Functions				   media_findname(3VOLMGT)

NAME
media_findname - convert a supplied name into an absolute pathname that can be used to access removable media SYNOPSIS
cc [ flag ... ] file ... -lvolmgt [ library ... ] #include <volmgt.h> char *media_findname(char *start); DESCRIPTION
This function is obsolete. The management of removable media by the Volume Management feature, including vold, has been replaced by soft- ware that supports the Hardware Abstraction Layer (HAL). Programmatic support for HAL is through the HAL APIs, which are documented on the HAL web site. See hal(5). The return value of this function is undefined. media_findname() converts the supplied start string into an absolute pathname that can then be used to access a particular piece of media. The start parameter can be one of the following types of specifications: /dev/... An absolute pathname in /dev, such as /dev/rdiskette0, in which case a copy of that string is returned (see NOTES on this page). volume_name The volume name for a particular volume, such as fred (see fdformat(1) for a description of how to label floppies). volmgt_symname The symbolic name for a device, such as floppy0 or cdrom2. media_type The generic media type name. For example, floppy or cdrom. In this case media_findname() looks for the first piece of media that matches that media type, starting at 0 (zero) and continuing on until a match is found (or some fairly large maximum number is reached). In this case, if a match is found, a copy of the pathname to the volume found is returned. RETURN VALUES
The return from this function is undefined. ERRORS
For cases where the supplied start parameter is an absolute pathname, media_findname() can fail, returning a null string pointer, if an lstat(2) of that supplied pathname fails. Also, if the supplied absolute pathname is a symbolic link, media_findname() can fail if a read- link(2) of that symbolic link fails, or if a stat(2) of the pathname pointed to by that symbolic link fails, or if any of the following is true: ENXIO The specified absolute pathname was not a character special device, and it was not a directory with a character special device in it. EXAMPLES
Example 1 Sample programs of the media_findname() function. The following example attempts to find what the pathname is to a piece of media called fred. Notice that a volmgt_check() is done first (see the NOTES section on this page). (void) volmgt_check(NULL); if ((nm = media_findname("fred")) != NULL) { (void) printf("media named "fred" is at "%s" ", nm); } else { (void) printf("media named "fred" not found "); } This example looks for whatever volume is in the first floppy drive, letting media_findname() call volmgt_check() if and only if no floppy is currently known to be the first floppy drive. if ((nm = media_findname("floppy0")) != NULL) { (void) printf("path to floppy0 is "%s" ", nm); } else { (void) printf("nothing in floppy0 "); } ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |MT-Level |MT-Unsafe | +-----------------------------+-----------------------------+ |Interface Stability |Obsolete | +-----------------------------+-----------------------------+ SEE ALSO
cc(1B), fdformat(1), lstat(2), readlink(2), stat(2), free(3C), malloc(3C), volmgt_check(3VOLMGT), volmgt_inuse(3VOLMGT), volmgt_root(3VOLMGT), volmgt_running(3VOLMGT), volmgt_symname(3VOLMGT), attributes(5), hal(5) NOTES
If media_findname() cannot find a match for the supplied name, it performs a volmgt_check(3VOLMGT) and tries again, so it can be more effi- cient to perform volmgt_check() before calling media_findname(). Upon success media_findname() returns a pointer to string which has been allocated; this should be freed when no longer in use (see free(3C)). SunOS 5.11 2 Mar 2007 media_findname(3VOLMGT)
All times are GMT -4. The time now is 09:33 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy