Sponsored Content
Full Discussion: Shell script to copy file
Top Forums Shell Programming and Scripting Shell script to copy file Post 302496415 by hainguyen1402 on Monday 14th of February 2011 03:32:01 AM
Old 02-14-2011
Thank Amitranjansahu so much,
It works perfectly...!!
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Shell script to search for text in a file and copy file

Compete noob question.... I need a script to search through a directory and find files containing text string abcde1234 for example and then copy that file with that text string to another directory help please :eek: (9 Replies)
Discussion started by: imeadows
9 Replies

2. Shell Programming and Scripting

Help with a shell script to modify one line and copy the next 9 to same file

Hi everyone, the problem is quite simple, yet I can't find an easy solution using awk. I need to search for a string in $3, then if I find this string, copy the line,modify $3, and copy the next 9 lines to the same file. My problem is in the copying of the lines... Finding and modifying... (5 Replies)
Discussion started by: Teroc
5 Replies

3. Shell Programming and Scripting

Shell Script - Copy File at intervals

Hi, I want to copy some files from a Folder say, /usr/X at random intervals to another location. Basically, new files will be dumped at random intervals to location /usr/X and I have to copy those new files to some other location (after copying, I cannot delete those files from source... (2 Replies)
Discussion started by: angshuman_ag
2 Replies

4. Shell Programming and Scripting

Solaris KSH shell script to copy all lines from one file to another

Hello, more of a windows wscript guy. However I took a new position that requires me to support some solaris servers. So... issue is that I need to copy all lines from a file to a temporary file and then copy them back into the original file starting at line 1. Reason I need to do this is... (5 Replies)
Discussion started by: ZigZaggin
5 Replies

5. Shell Programming and Scripting

Shell script for searching a record,copy to a file and then delete it

Hi, I have a requirement in hand: I have a file with millions of records say file 1.I have another file, say file 2 which has 2000 records in it. The requirement is to read file2 , and remove the read record from file 1 and move i to a seperate file, file 3. For eg: Read file 2, get the... (5 Replies)
Discussion started by: kumara2010
5 Replies

6. Shell Programming and Scripting

Shell script to copy a log file if it exceeds 5000000 bytes

Hi, on unix box, under /local/home/userid/logs folder, apps generated the following files sw_warn.log sw_error.log eaijava.log if there any application specific errors, the above file will keep growing. if the file exceed 5000000 bytes, I would like to have a shell script which do... (6 Replies)
Discussion started by: lookinginfo
6 Replies

7. Shell Programming and Scripting

Shell Script Problems, Lose formatting when copy pasting from formatted file.

Hello, I'm having trouble with formatting some text via the terminal. I can get it perfectly formatted, but when I try and copy paste the text from the output file it loses it's formatting. Very frustrating! Basically I have 7 files (data data2 data3 data4 data5 data6 data7) containing a... (13 Replies)
Discussion started by: facetoe
13 Replies

8. Shell Programming and Scripting

Shell script to copy particular file from directories recursively

I have directory path in which there are several sub directories. In all these sub dir there will be one env.cnf file. I want to copy this env.cnf file from each sub dir's and place them in destination path by creating same filename as sub dir_env.cnf. After copying env.cnf files from source... (4 Replies)
Discussion started by: Optimus81
4 Replies

9. UNIX for Dummies Questions & Answers

Download .xls file from mail and copy to another path using shell script

Hi I have a mail attachment coming from a mail id and evreytime with the same name in .xls format.I have to download the .xls file into a location and convert it itno .csv format and copy the .csv file to another location. (1 Reply)
Discussion started by: bikky6
1 Replies

10. Shell Programming and Scripting

Shell script which will check the target file and folder exists and copy it

Hi All, I am a beginner in this and trying to write a shell script in linux which will : 1. Ask for a file name and check if its exists. 2. If file exists only then it will ask for the new target folder, after entering target folder name it will check if it exists. 3. If target folder... (3 Replies)
Discussion started by: ashish_neekhra
3 Replies
cvmkfile(1)                                                        cvmkfile(1)

NAME
cvmkfile - Create a pre-allocated file SYNOPSIS
cvmkfile [-k <key>] [-p] [-s] [-w] [-z] <size>[k|m|g] <filename> DESCRIPTION
cvmkfile can be used to pre-allocate a file on the Xsan volume. This is useful and preferable when preparing a file for use in a real-time or streaming environment as the entire file is represented in only one file system extent. Additionally, a file can be placed onto a specific storage pool by specifying the <key> value, which is used as the affin- ity locator. See cvfs_config(4) for more details about affinities. USAGE
The -k <key> optionally tells the file system where to place the data file. If an Affinity Key is specified, the file is placed on storage pools that are specified to support this key. If there is no storage pool with the key specified, then the file is placed in non-exclusive data pools. If there are no non-exclusive data pools, then ENOSPC (no space) is returned. The -p option forces the allocation and any subsequent expansions to be fitted "perfectly" as multiples of the InodeExpandMin configuration parameter. The allocation extent will always line up on and be a per- fect multiple of the blocks specified in InodeExpandMin. The -s option forces the allocation to line up on the beginning block modulus of the storage pool. This can help performance in situations where the I/O size perfectly spans the width of the storage pool's disks. The -w option sets the file size to be equal to <size>. Without this option the blocks are allocated but the size is set to zero. NOTE: Unless the -z option is used, the new file will contain undefined data. Using the -w option is not recommended unless absolutely needed. The -z option causes the file to be physically zeroed out. This can take a significant amount of time. The <size> argument specifies the number of bytes, kilobytes(k), megabytes(m) or gigabytes(g) to allocate for the file. There is no guarantee that all requested space will be allocated. If there is insufficient contiguous available space to satisfy the requested amount then a "best effort" will be performed. In this case a success value is returned even though not all of the requested amount is allocated to the file. Even though the allocation may not be fully satisfied, if the -w option is specified then the file size will still reflect the requested <size> value. EXAMPLES
Make a file of one gigabyte with zero length. Allocate it on a storage pool that favors the media type 6100_n8. rock # cvmkfile -k 6100_n8 1g foobar SEE ALSO
cvfs_config(4), cvmkdir(1) Xsan File System December 2005 cvmkfile(1)
All times are GMT -4. The time now is 03:56 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy