How to count successfully copy files source to target location with check directory in Linux?


 
Thread Tools Search this Thread
Contact Us Post Here to Contact Site Administrators and Moderators How to count successfully copy files source to target location with check directory in Linux?
# 1  
Old 07-23-2015
How to count successfully copy files source to target location with check directory in Linux?

Hi guys...please any one help me ....
how to copy files from source to target location
if 5 files copied successfully out of 10 files then implement success=10
and if remaining 5 files not copied successfully then count error=5
how to implement this condition with in loop

i need code linux shell script or putty terminal useful code
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Count the number of files copied from source to destination location

Hi Guys, how to count number of files successfully copied while coping files from source to destination path ex:10 files from source to target location copying if 8 files copied successfully then echo successfully copied=8 failure=2 files if two files get error to coping files from... (23 Replies)
Discussion started by: sravanreddy
23 Replies

2. Shell Programming and Scripting

Error files count while coping files from source to destination locaton as well count success full

hi All, Any one answer my requirement. I have source location src_dir="/home/oracle/arun/IRMS-CM" My Target location dest_dir="/home/oracle/arun/LiveLink/IRMS-CM/$dc/$pc/$ct" my source text files check with below example.text file content $fn "\t" $dc "\t" $pc "\t" ... (3 Replies)
Discussion started by: sravanreddy
3 Replies

3. UNIX for Dummies Questions & Answers

How to count number files successfully copied from source to target location?

Hi Guys, how to count number of files successfully copied while coping files from source to destination path ex:10 files from source to target location copying if 8 files copied successfully then echo successfully copied=8 failure=2 files if two files get error to coping files... (2 Replies)
Discussion started by: sravanreddy
2 Replies

4. 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

5. Shell Programming and Scripting

Shell Script for Copy files from one location to another location

Create a script that copies files from one specified directory to another specified directory, in the order they were created in the original directory between specified times. Copy the files at a specified interval. (2 Replies)
Discussion started by: allways4u21
2 Replies

6. HP-UX

Copy only files whiich do not exist on Target Directory

Hi, I am using HP-UX B 11.23 I want to copy files from one directory into another directory in such a way that, only the nonexistent files in target directory are copied from source directory e.g. dir1 has file1 file2 file3 dir2 has file1 file3 now I want that a command... (7 Replies)
Discussion started by: Chetanaz
7 Replies

7. Shell Programming and Scripting

Shell script to transfer the files from source to target server.

I need to write a shell script to transfer the files every hour from source - target server. The cron job should be running every hour and shouldn't copy already copied files to the remote server ? I was able to write intial script but not able to get the logic for (in the next run it should... (12 Replies)
Discussion started by: radhirk
12 Replies

8. UNIX for Dummies Questions & Answers

Copy directory from one location to other

Hi All, I am newbie for Unix. I want to copy a directory from one location to other. Can any one help me by providing the command to do following task. thanks in advance, Rakesh (2 Replies)
Discussion started by: rakeshvthu
2 Replies

9. UNIX for Advanced & Expert Users

copy files from one location to similar location

I need help in forming a script to copy files from one location which has a sub directory structure to another location with similar sub directory structure, say location 1, /home/rick/tmp_files/1-12/00-25/ here 1-12 are the number of sub directories under tmp_files and 00-25 are sub... (1 Reply)
Discussion started by: pharos467
1 Replies

10. Shell Programming and Scripting

Source and Target count checking

Hi My source database is seibel and the target is oracle. I need to check the count for source query and target query. if it is equal then i need to send and success mail to an email id. If it is not equal need to send an failure mail to an email id. pl let me know about the script in ksh. ... (2 Replies)
Discussion started by: ksmbabu
2 Replies
Login or Register to Ask a Question
xfs_copy(8)						      System Manager's Manual						       xfs_copy(8)

NAME
xfs_copy - copy the contents of an XFS filesystem SYNOPSIS
xfs_copy [ -bd ] [ -L log ] source target1 [ target2 ... ] DESCRIPTION
xfs_copy copies an XFS filesystem to one or more targets in parallel (see xfs(5)). The first (source) argument must be the pathname of the device or file containing the XFS filesystem. The remaining arguments specify one or more target devices or file names. If the pathnames specify devices, a copy of the source XFS filesystem is created on each device. The target can also be the name of a regular file, in which case an image of the source XFS filesystem is created in that file. If the file does not exist, xfs_copy creates the file. The length of the resulting file is equal to the size of the source filesystem. However, if the file is created on an XFS filesystem, the file consumes roughly the amount of space actually used in the source filesystem by the filesystem and the XFS log. The space saving is because xfs_copy seeks over free blocks instead of copying them and the XFS filesystem supports sparse files efficiently. xfs_copy should only be used to copy unmounted filesystems, read-only mounted filesystems, or frozen filesystems (see xfs_freeze(8)). Oth- erwise, the generated filesystem(s) would be inconsistent or corrupt. xfs_copy does not alter the source filesystem in any way. Each new (target) filesystem is identical to the original filesystem except that new filesystems each have a new unique filesystem identifier (UUID). Therefore, if both the old and new filesystems will be used as sepa- rate distinct filesystems, xfs_copy or xfsdump(8)/xfsrestore(8) should be used to generate the new filesystem(s) instead of dd(1) or other programs that do block-by-block disk copying. xfs_copy uses synchronous writes to ensure that write errors are detected. xfs_copy uses pthreads(7) to perform simultaneous parallel writes. xfs_copy creates one additional thread for each target to be written. All threads die if xfs_copy terminates or aborts. OPTIONS
-d Create a duplicate (true clone) filesystem. This should be done only if the new filesystem will be used as a replacement for the original filesystem (such as in the case of disk replacement). -b The buffered option can be used to ensure direct IO is not attempted to any of the target files. This is useful when the filesystem holding the target file does not support direct IO. -L log Specifies the location of the log if the default location of /var/tmp/xfs_copy.log.XXXXXX is not desired. DIAGNOSTICS
xfs_copy reports errors to both stderr and in more detailed form to a generated log file whose name is of the form /var/tmp/xfs_copy.log.XXXXXX or a log file specified by the -L option. If xfs_copy detects a write error on a target, the copy of that one target is aborted and an error message is issued to both stderr and the log file, but the rest of the copies continue. When xfs_copy termi- nates, all aborted targets are reported to both stderr and the log file. If all targets abort or if there is an error reading the source filesystem, xfs_copy immediately aborts. xfs_copy returns an exit code of 0 if all targets are successfully copied and an exit code of 1 if any target fails. NOTES
When moving filesystems from one disk to another, if the original filesystem is significantly smaller than the new filesystem, and will be made larger, we recommend that mkfs.xfs(8) and xfsdump(8)/xfsrestore(8) be used instead of using xfs_copy and xfs_growfs(8). The filesys- tem layout resulting from using xfs_copy/xfs_growfs is almost always worse than the result of using mkfs.xfs/xfsdump/xfsrestore but in the case of small filesystems, the differences can have a significant performance impact. This is due to the way xfs_growfs(8) works, and not due to any shortcoming in xfs_copy itself. CAVEATS
xfs_copy does not copy XFS filesystems that have a real-time section or XFS filesystems with external logs. In both cases, xfs_copy aborts with an error message. SEE ALSO
mkfs.xfs(8), xfsdump(8), xfsrestore(8), xfs_freeze(8), xfs_growfs(8), xfs(5). xfs_copy(8)