Sponsored Content
Full Discussion: Any Ideas?
Top Forums Shell Programming and Scripting Any Ideas? Post 22758 by RTM on Monday 10th of June 2002 01:34:33 PM
Old 06-10-2002
To check if the file is not being accessed by a process (even ftp) use fuser filename. Check the man page on fuser.

For renaming files - add the date or time to the file
date +%m%e%y-%T so each one is unique (add seconds if you have that many files)

You can cat multiple files into one using redirection.
 

8 More Discussions You Might Find Interesting

1. Cybersecurity

Any Ideas !!!!!!!!!!

Hi, I installed sybase server on a LINUX server. I assigen port 2025 whilst installation for sybase , later i uninstalled sybase and when i try to reinstall sybase and use port 2025 it throw up error saying that it is already in use, use other port number. How can I re-use the same port number... (2 Replies)
Discussion started by: suda
2 Replies

2. Shell Programming and Scripting

any ideas?

i need to compare to dates/times given in the format MMDDhhmmYY. That is month, day, hour, minute, year. It is a 24 hour clock. I need to compare two dates to check that they are, say, less than 900 seconds apart. I have got to a point where it checks the time, turns the values into seconds and... (5 Replies)
Discussion started by: fwabbly
5 Replies

3. Shell Programming and Scripting

Scripting ideas?

Hi All, How can I script the following logic? Step 1: Check if the file xyz.txt exists under direcotry test and if the size of the file xyz.txt is greater than 32MB. Step 2: If the above conditions are true(file exists and size >32 MB), then step 3, otherwise step 4 (file does not exist or... (2 Replies)
Discussion started by: Sueyoung88
2 Replies

4. Solaris

Need ideas what is wrong with v440

Hello everyone, I'm here today looking for help... I have a SunFire v440 running Solaris 9 at work that manages the SCSI tape drives(LTO3) in our L700 tape library (runs SAMFS). I went into work today and found the machine was ping-able but I could not connect to it via SSH and could not... (7 Replies)
Discussion started by: mainegeek
7 Replies

5. UNIX for Advanced & Expert Users

Sendmail - Any Ideas?

I have solaris 9 and am using sendmail to pickup requests and forward them to a bulk mail server on a different port. Now for the fun...In sendmail, I need to find a way to place a default address in the Mail From: and Rcpt To: or remove them as required - These will be picked up by the bulk mail... (3 Replies)
Discussion started by: mikey2003ma
3 Replies

6. UNIX and Linux Applications

Need ideas for graduation project based on unix or linux Need ideas for graduation project based on

Dear all, i am in last year of electronics department in engineering faculty i need suggestions for a graduation project based on unix or free bsd or linux and electronics "embedded linux " i think about embedded unix for example or device drivers please i need helps (1 Reply)
Discussion started by: MOHA-1
1 Replies

7. Shell Programming and Scripting

Ideas for while loop

idealy, i'd like to do something like this: while read line do echo $line done < $(egrep error /var/log/syslog) but when i do, i get an unexpected response. i.e. cat test: #!/bin/sh while read line do echo $line done < $(egrep error /var/log/syslog) (12 Replies)
Discussion started by: SkySmart
12 Replies

8. Shell Programming and Scripting

Help me get some ideas

Hello, I have been given a scripting project, but have not learned any scripting. I need to get some ideas on how to start. Attached is part of the project: I have no idea how to parse the arguments. What I had in mind was to get the arguments ($1, $2, ... ) and have if statements for different... (1 Reply)
Discussion started by: facepalm
1 Replies
fuser(8)						      System Manager's Manual							  fuser(8)

NAME
fuser - Lists process IDs of processes that are using one or more files or file structures SYNOPSIS
/usr/sbin/fuser [-cfu] file ... [Tru64 UNIX] The following format shows extensions not included in the XCU specification for this utility: /usr/sbin/fuser [-cdfku] [-h] [-vH] file ... STANDARDS
Interfaces documented on this reference page conform to industry standards as follows: fuser: XCU5.0 Refer to the standards(5) reference page for more information about industry standards and associated tags. FLAGS
Identifies file as a mount point. In this case, fuser reports on any files that are open in the mounted file system. Report any refer- enced files that have been deleted including the referencing PID and the block count for the file in 512 byte block units. Requests a report only for the specified files. If a specified file is a mount point, fuser reports only on that file, not on any files below it. [Tru64 UNIX] Suppresses column headings in fuser output when used with the -v flag. [Tru64 UNIX] Directs fuser to display information about its command-line options. [Tru64 UNIX] Directs fuser to send a SIGKILL signal to each process. Because this flag spawns a kill operation for each process, the kill messages may not show up immediately. Directs fuser to show the user login name, in parentheses, associated with each process ID. [Tru64 UNIX] Directs fuser to display results in verbose form. PARAMETERS
[Tru64 UNIX] Directs fuser to ignore previous flag settings for the next set of file parameters. The - operand allows you to apply differ- ent flags to different sets of files in the same command line. Specifies the pathname of the file or the mount point of the file system on which fuser reports. DESCRIPTION
The fuser utility writes to standard output the process IDs of processes that are running on the local system and have one or more files or file structures in use. The utility writes to standard error additional information about these resources that indicates how each resource is being used. If file identifies a block special device, fuser lists all processes using any file on that device. This utility does not display information about files for which you do not have the appropriate privileges. For information on many files, root privilege may be required. Furthermore, you must have appropriate privileges to use the -k flag. The utility uses the following format to write the process ID for each process using each file: "%d", process_id The fuser utility writes diagnostic messages to standard error. In addition, the utility writes the following information to standard error: The pathname of each file, immediately followed by a colon. For each process ID written to standard output, one of the following characters: If the process is using the file as its current directory. [Tru64 UNIX] If the process is using a memory-mapped file. [Tru64 UNIX] If the process is using the file as the parent of its current directory. If the process is using the file as its root directory. [Tru64 UNIX] If the process has the file open. [Tru64 UNIX] If the process is using the file as its controlling tty. [Tru64 UNIX] If the process is using the text file as an executable. If you specify the -u flag, characters indicating the use of the file are followed immediately by the user name, in parentheses, that corresponds to the process's real user ID. If the user name cannot be resolved from the process's real user ID, the process's real user ID is written instead of the user name. When standard output and standard error are directed to the same file, the utility intersperses output so that the file appears at the start of each line, followed by the process ID and the characters indicating file use. Then, if the -u option is specified, the utility writes the user name or user ID for each process that is using that file. The utility writes a newline character at the end of output for each file. ENVIRONMENT VARIABLES
The following environment variables affect this utility: Provides a default value for the locale variables that are unset or null. If LANG is unset or null, the corresponding value from the POSIX (C) locale is used. If any of the locale variables contain an invalid setting, the utility behaves as if none of the variables had been set. If set to a non-empty string value, overrides the values of all the other locale variables. Specifies the locale used to interpret sequences of bytes of text data as characters (for example, determines whether arguments contain single-byte or multibyte characters). Specifies the locale that affects the format and contents of diagnostic messages written to standard error. Determines the location of message catalogs for the processing of LC_MESSAGES. NOTES
[Tru64 UNIX] The fuser utility may not report on processes that begin using a file while the utility is running. Furthermore, processes that fuser reports are using a file may have stopped using it while the utility was running. EXAMPLES
The following command lists the process IDs of processes using the /etc/hosts file: fuser /etc/hosts The following command writes to standard output the process IDs of processes that are using the current directory. The command writes to standard error an indication of how those processes are using the directory and the user names associated with those processes. fuser -fu . EXIT VALUES
The fuser utility returns the following exit values: Successful completion. An error occurred. RELATED INFORMATION
Functions: fuser(2), kill(2) delim off fuser(8)
All times are GMT -4. The time now is 02:07 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy