Sponsored Content
Full Discussion: fuser
Top Forums UNIX for Dummies Questions & Answers fuser Post 302498183 by tjmannonline on Sunday 20th of February 2011 07:08:19 AM
Old 02-20-2011
fuser -f worked, but now i ran into another issue. my script:

fuser -f file1 > /tmp/active.log

if [ -s /tmp/active.log ] && [ -s /tmp/file2 ]
then
echo "exiting"
exit
else
mv /tmp/file2 /tmp/file2.timestamp
fi

since this crontab runs * * * * *, mv /tmp/file2 /tmp/file2.timestamp "A file or directory in the path name does not exist".
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Help with fuser

fuser is used to check whether a file is in use by a process or not. I was putting some information in a file via a background process and was doing a cat to see the contents. It gave me the pid of background process followed by stop. Understood only half, stopped because it was writing on it... (11 Replies)
Discussion started by: vibhor_agarwali
11 Replies

2. AIX

fuser brought down the box

I issued fuser -k -x -u ./amqcc_r It brought down the whole box The unix admin says if I had issued fuser -k -x -u amqcc_r then it would have not brouht down the box. Does it make sense to you guys (5 Replies)
Discussion started by: bandaru
5 Replies

3. UNIX for Advanced & Expert Users

fuser ?? Look at the script !!

#SCRIPT TO CHECK WHO HAS ACCESSED THE LOG/FILE IN PAST 'N' MINUTES, AND MAIL ACCORDINGLY. MYPATH="/clocal/mqbrkrs/user/mqsiadm/sanjay/" MAIL_RECIPIENTS="abc@xyz.com" Subject="File accessed in last few minutes" >tempmail.txt >tempfind.txt find "$MYPATH" -type f -amin -1 > tempfind.txt cat... (0 Replies)
Discussion started by: varungupta
0 Replies

4. Shell Programming and Scripting

help needed in fuser command

Hi all, I want to know if fuser command can be used to check if a file is being written or not??? Thanks In Advance Anju (1 Reply)
Discussion started by: anju
1 Replies

5. UNIX for Dummies Questions & Answers

fuser

Anyone ever use fuser, i tried this command fuser /database.bk but it only returns datbase.bk: I read some of the forums online, one of them said when he used fuser, it broke down the box, i really don't want that happen. I thought fuser is to see who is accessing that file, right? any... (8 Replies)
Discussion started by: adrianlearnpro
8 Replies

6. Solaris

FUSER problems

Greetings, I need help understanding why FUSER will not bring back PSID's on mounted filesystems. Is this a common error? Thanks in advance for your feedback. (11 Replies)
Discussion started by: Harleyrci
11 Replies

7. UNIX for Dummies Questions & Answers

fuser on aix vs. linux

Pls. advise why on AIX the exit status is always '0' and on Linux it is always '1' even if the I just created a new file. I'm thinking if there is a background process monitoring the created 'file1' on AIX even if it is just a dummy or new file. How can I resolve this. (I need to justify that... (1 Reply)
Discussion started by: budz26
1 Replies

8. AIX

Fuser on VXFS not reporting processes

I have a perl script like : #! /usr/bin/perl open FILE1,">/tmp/openfile.test.out"; open FILE2,"</tmp/openfile.test.in"; open FILE3,">/data/openfile.test.out"; open FILE4,"</data/openfile.test.in"; <STDIN>; close FILE1; close FILE2; close FILE3; close FILE4; /tmp is jfs2... (0 Replies)
Discussion started by: petervg
0 Replies

9. UNIX for Advanced & Expert Users

Fuser alternative OR running fuser on a script

Hi, Not sure whether there is a fuser alternative or any better way to check for file in use or not. I am wanting to check whether files are in use or not before removing them. Using fuser, the awk seems to be giving me 'weird' output not to mention that it is giving me 2 lines instead of... (0 Replies)
Discussion started by: newbie_01
0 Replies

10. Shell Programming and Scripting

Unable to get pid from fuser

bash-3.2$ fuser -f /bin/nohup.out /bin/nohup.out: 13136o 13111o The pid is 13136. Can you tell me how can i extract just the pid 13136 from the above output ? bash-3.2$ uname -a SunOS mymac 5.10 Generic_150400-26 sun4v sparc sun4v I was trying on this lines but i get strange... (3 Replies)
Discussion started by: mohtashims
3 Replies
FILEMTIME(3)								 1							      FILEMTIME(3)

filemtime - Gets file modification time

SYNOPSIS
int filemtime (string $filename) DESCRIPTION
This function returns the time when the data blocks of a file were being written to, that is, the time when the content of the file was changed. PARAMETERS
o $filename - Path to the file. RETURN VALUES
Returns the time the file was last modified, or FALSE on failure. The time is returned as a Unix timestamp, which is suitable for the date(3) function. EXAMPLES
Example #1 filemtime(3) example <?php // outputs e.g. somefile.txt was last modified: December 29 2002 22:16:23. $filename = 'somefile.txt'; if (file_exists($filename)) { echo "$filename was last modified: " . date ("F d Y H:i:s.", filemtime($filename)); } ?> ERRORS
/EXCEPTIONS Upon failure, an E_WARNING is emitted. NOTES
Note Note that time resolution may differ from one file system to another. Note The results of this function are cached. See clearstatcache(3) for more details. Tip As of PHP 5.0.0, this function can also be used with some URL wrappers. Refer to "Supported Protocols and Wrappers" to determine which wrappers support stat(3) family of functionality. SEE ALSO
filectime(3), stat(3), touch(3), getlastmod(3). PHP Documentation Group FILEMTIME(3)
All times are GMT -4. The time now is 01:09 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy