Sponsored Content
Top Forums Shell Programming and Scripting Silly question - how does the "mv" command work? Post 302413629 by jgt on Friday 16th of April 2010 12:01:44 PM
Old 04-16-2010
If both directories are in the same file system only the inode table is updated, the file does not actually move

---------- Post updated at 12:01 PM ---------- Previous update was at 11:54 AM ----------

Quote:
However, I have a feeling that this "other program" is grabbing this file too soon as the "mv" hasn't successfully completed writing the files contents; perhaps just the filename.
If the two directories involved in the mv are on different file systems, the a copy and delete is done
However, unix systems will show the file in a ls as soon as it is opened for writing, so your second program should confirm that the file is not in use (use fuser), otherwise you may process a partial file.
 

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

"man date" command does not work

Hi there I'm logged in as root on a UNIX Spark 10 using a SSH client. I notice that the time on the machine is wrong and I type "man date" in order to receive the options how to change this. When typing "man date" and hitting Enter I get the message "No manual entry for date" Why? Am I... (1 Reply)
Discussion started by: aptit
1 Replies

2. Shell Programming and Scripting

How to get Find command work with a variable passing "*" value?

Hi guy, I have a problem to pass a variable containing '*' value to FIND command. below is the script. It doesn't work by submit below command: rmf.sh name '*.txt' or rmf.sh name *.txt I've tried either optn="-name '$2'" or optn="-name $2"., and there is no luck. ### (script... (5 Replies)
Discussion started by: unxuser
5 Replies

3. UNIX for Advanced & Expert Users

sometimes "ps -elf" command doesn't work

when i give "ps -elf" or "ps" system gets hung. if i press "^c" come out from it... pls help..what should i do to get it resolved. thanks CKanth (4 Replies)
Discussion started by: srikanthus2002
4 Replies

4. AIX

"/" doesn't work on command prompt for searching commands last typed

When I use "/" to look for a particular command that I typed in the current session it says D02:-/home/user1/temp> /job ksh: /job: not found. D02:-/home/user1/temp> previously it used to fetch all the commands which had job in it.. for example subjob, endjob, joblist etc... may I... (7 Replies)
Discussion started by: meetzap
7 Replies

5. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

6. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

7. Red Hat

"/usr/sbin/hpacucli ctrl all show" command does not work

Dear Concern, We have observed that following command stuck/does not work in some RedHat nodes. Please advise us to troubleshoot the issue. /usr/sbin/hpacucli ctrl all show Note: HP Array Configuration Utility CLI for Linux 64-bit With Best Regards, Md. Abdullah-Al Kauser (3 Replies)
Discussion started by: makauser
3 Replies

8. UNIX for Beginners Questions & Answers

"Mv" command does not work in loop, but works manually

Hi there, this may be a beginner's error, but I've been unable to find a solution on my own and by googling, and now I am really stuck on it. I am simply trying to move directories called for example CAT_Run01.ica to a directory with the corresponding number, Run01, in the same directory. For... (2 Replies)
Discussion started by: andrevol
2 Replies
fs_async(5)							File Formats Manual						       fs_async(5)

NAME
fs_async - enables write calls to return before write operation is complete VALUES
Failsafe Default Allowed values The allowed values are: (use synchronous disk writes only), or (allow asynchronous disk writes). Specify a positive integer value, or DESCRIPTION
specifies whether or not asynchronous writing of file system data structures to disk is allowed. Synchronous writes to disk make it easier to restore file system integrity if a system crash occurs while file system data structures are being updated on the file system. If asynchronous writes are selected, HP-UX file system semantics for NFS cluster environments are preserved. In addition, files opened using with the flag (synchronous writing) will continue to be written synchronously when the asynchronous-writes feature has been config- ured into the kernel. Asynchronous writes to disk can improve file system performance significantly. However, asynchronous writes can leave file system data structures in an inconsistent state in the event of a system crash. For more information about when to select synchronous or asynchronous writing, see the following tutorial. Restrictions on Changing This tunable is static. Any changes to the value of this tunable will require system reboot before taking effect. Tutorial: What are Synchronous and Asynchronous Writes? If a file is open for writing and data is being written to a file, the data is accumulated in buffers and periodically written to disk. When an end-of-file condition occurs and the file is to be closed, any remaining buffer contents are written to the disk, the inode is updated with file size and block pointer information, and the file system's list of free disk blocks is updated. To ensure maximum protec- tion of file system integrity, these operations are handled in a specific sequence that minimizes the risk of file system corruption on the disk if a system crash or power failure occurs while writing to the disk. This sequential update process is called HP-UX file systems store free space lists, blocks, inodes, and other file components in random and widely separate locations on disk devices. This means that writing file information blocks in a particular sequence requires additional time to move to the desired location on the disk before performing the write operation. If a power failure or system crash occurs during this sequence, one or more blocks may not be properly updated, leaving a potentially inconsistent file system. The command is used to repair such inconsistencies. Asynchronous writing as it relates to the kernel parameter allows the system to update file system information on the disk in a more conve- nient (hence faster) sequence rather than in a more secure (safer but slower) sequence, thus reducing search and move delays between writes. However, if a system crash occurs while these operations are being performed, the risk of an inconsistent file system that cannot be automatically repaired by is significantly greater than with synchronous writes. If only synchronous writing is used, all updates to directories, file inodes, free space lists, and so on are handled in a sequence that is known to If a crash occurs while updating any disk block in the sequence, can readily determine where the crash occurred and repair the missing update information, probably without assis- tance from the system administrator. If is set to allow asynchronous writes and a crash occurs, does not know what sequence was used, and thus will probably require interactive assistance from the administrator while fixing inconsistent file system information, repairing directory and inode entries, and so on. Waiting for synchronous writing and updating of disk blocks when closing files after writing to them degrades the performance of programs and applications that require frequent file and directory write and close operations. Allowing asynchronous writing significantly reduces those delays, producing a corresponding improvement in performance. However, when applications are CPU intensive with relatively little disk I/O, performance improvements are much lower. Asynchronous writing is advisable for improving system performance if: o Risk of power failure is low (very dependable power source and/or uninterruptible power sources). o Precautions have been taken to enhance data security (sophisticated file system backup or redundancy strategies), or potential loss of data due to a system crash is less important than system performance. o User applications require frequent opening, writing, and closing of disk files and directories. o Elimination of synchronous writing would improve system performance sufficiently to offset any associated risks. To enable asynchronous writing, set the kernel parameter to instead of the default value of WARNINGS
All HP-UX kernel tunable parameters are release specific. This parameter may be removed or have its meaning changed in future releases of HP-UX. Installation of optional kernel software, from HP or other vendors, may cause changes to tunable parameter values. After installation, some tunable parameters may no longer be at the default or recommended values. For information about the effects of installation on tun- able values, consult the documentation for the kernel software being installed. For information about optional kernel software that was factory installed on your system, see at AUTHOR
was developed by HP. SEE ALSO
fsck(1M), kctune(1M), sam(1M), gettune(2), open(2), settune(2). Tunable Kernel Parameters fs_async(5)
All times are GMT -4. The time now is 06:53 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy