Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Moving file using shell script fails occasionally Post 303046065 by RudiC on Wednesday 22nd of April 2020 04:17:10 PM
Old 04-22-2020
Quote:
Originally Posted by Sac
.
.
.
when i add the script to cronjob, am getting file count mismatch.

Ex: If 1000 files got copied in one day then only 950/960 are moved.

A bit difficult to believe. Pls add facts: file names / count to be copied, file names / count that have been copied, script.source.file's content, error messages, permissions on target directoroies / files, ...
And, don't underestimate MadeInGermany's hint: with $SOURCEONEACTUAL a relative path, applying cd $SOURCEONEACTUAL several times you'll end up in ./a/a/a..., i.e. nirwana.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

need shell script for moving file one by one

#SD=source dir TD= target dir SD="$/amddev/app01/manoj/new/scripts/old" TD="$/amddev/app01/manoj/new/scripts/new" EXT="$*.txt" for i in `ls -F "$SD"/*"$EXT"|grep -v /$` do mv "$SD" "$TD" if then echo "$i" successfully moved echo Manoj successfully..1 ( here i... (8 Replies)
Discussion started by: manojkarthi
8 Replies

2. Shell Programming and Scripting

why shell script fails

hi .. I have automate some process on unix through sehll script . but i don't know there is some problem in scripts, some time shell script works and some time it fails. so my query is that "Why shell script fails some times?" thanks (4 Replies)
Discussion started by: tahir23
4 Replies

3. Shell Programming and Scripting

why shell script fails?

hi , i m trying to run a shell script automatically , some time it works fine but some time it fails , what could be the problem . If anybody have an idea about this problem then reply . Thanks in advacne (4 Replies)
Discussion started by: tahir23
4 Replies

4. Shell Programming and Scripting

shell script for moving all the file from the same folder

Hi , I need a shell script which basicaly moves all the files from one folder say folder x to folder y and once they are moved to folder y a datetimestamp should be attached to there name for ex file a should be moved to y folder and renamed as a_20081015 (1 Reply)
Discussion started by: viv1
1 Replies

5. Shell Programming and Scripting

Shell Script for moving 3 days old file to Archive Folder

Hi Experts, I have a "Source" folder which may contain some files. I need a shell script which should move all files which are older than 3 days to "Archive" folder. Thanks in Advance... (4 Replies)
Discussion started by: phani333
4 Replies

6. Shell Programming and Scripting

Execute shell script even if the first script fails

All, I executing a perl script and shell script from a master shell script. i will execute the perl script first and have to execute the shell script after the completion of perl execution. Below is the code i use for it, script_root='/dev/scripts' /usr/bin/perl -S $script_root/test.pl;... (5 Replies)
Discussion started by: vel4ever
5 Replies

7. Shell Programming and Scripting

How to exit from shell script if above condition fails?

HI cd ${back_home} if above back_home does not exist, then script shoul exit. Please let us know how to do that (7 Replies)
Discussion started by: buzzme
7 Replies

8. Shell Programming and Scripting

Shell Script for renaming and moving Files - Easy?

Hey guys, ive been working on this for about 2hrs now - without any solution. At first I need to say I dont have skills in linux bash scripting, but I tried to use some codesnippets and manuals from google. What I want to do: I have different folders including 2 different filestypes with... (15 Replies)
Discussion started by: peter1337
15 Replies

9. UNIX for Beginners Questions & Answers

Linux shell | how to exit a script if any command fails.

Hi, i am new here let me say HI for all. now i have a question please: i am sending one command to my machine to create 3 names. if one of the names exists then the box return error message that already have the name but will continue to create the rests. How i can break the command and... (7 Replies)
Discussion started by: Amiri
7 Replies

10. Shell Programming and Scripting

Array declared in shell script works for AIX but fails in Linux

Array declared in shell script works for AiX 6.1 and above but fails in Linux CentOS 7. I have the below code for Array in my shell script that runs fine on AiX systems. Note: on AiX it uses ksh shell while on Linux it uses non ksh shell. set -A filelist However, i now wish to use the... (3 Replies)
Discussion started by: mohtashims
3 Replies
xfs_metadump(8) 					      System Manager's Manual						   xfs_metadump(8)

NAME
xfs_metadump - copy XFS filesystem metadata to a file SYNOPSIS
xfs_metadump [ -efFgow ] [ -m max_extents ] ] [ -l logdev ] source target xfs_metadump -V DESCRIPTION
xfs_metadump is a debugging tool that copies the metadata from an XFS filesystem to a file. The source argument must be the pathname of the device or file containing the XFS filesystem and the target argument specifies the destination file name. If target is -, then the output is sent to stdout. This allows the output to be redirected to another program such as a compression application. xfs_metadump may only be used to copy unmounted filesystems, or read-only mounted filesystems. xfs_metadump does not alter the source filesystem in any way. The target image is a contiguous (non-sparse) file containing all the filesystem's metadata and indexes to where the blocks were copied from. By default, xfs_metadump obfuscates most file (regular file, directory and symbolic link) names and extended attribute names to allow the dumps to be sent without revealing confidential information. Extended attribute values are zeroed and no data is copied. The only excep- tions are file or attribute names that are 4 or less characters in length. Also file names that span extents (this can only occur with the mkfs.xfs(8) options where -n size > -b size) are not obfuscated. Names between 5 and 8 characters in length inclusively are partially obfuscated. xfs_metadump should not be used for any purposes other than for debugging and reporting filesystem problems. The most common usage scenario for this tool is when xfs_repair(8) fails to repair a filesystem and a metadump image can be sent for analysis. The file generated by xfs_metadump can be restored to filesystem image (minus the data) using the xfs_mdrestore(8) tool. OPTIONS
-e Stops the dump on a read error. Normally, it will ignore read errors and copy all the metadata that is accessible. -f Specifies that the filesystem image to be processed is stored in a regular file (see the mkfs.xfs -d file option). This can also happen if an image copy of a filesystem has been made into an ordinary file with xfs_copy(8). -F Specifies that we want to continue even if the superblock magic is not correct. If the source is truly not an XFS filesystem, the resulting image will be useless, and xfs_metadump may crash. -g Shows dump progress. This is sent to stdout if the target is a file or to stderr if the target is stdout. -l logdev For filesystems which use an external log, this specifies the device where the external log resides. The external log is not copied, only internal logs are copied. -m Set the maximum size of an allowed metadata extent. Extremely large metadata extents are likely to be corrupt, and will be skipped if they exceed this value. The default size is 1000 blocks. -o Disables obfuscation of file names and extended attributes. -w Prints warnings of inconsistent metadata encountered to stderr. Bad metadata is still copied. -V Prints the version number and exits. DIAGNOSTICS
xfs_metadump returns an exit code of 0 if all readable metadata is successfully copied or 1 if a write error occurs or a read error occurs and the -e option used. NOTES
As xfs_metadump copies metadata only, it does not matter if the source filesystem has a realtime section or not. If the filesystem has an external log, it is not copied. Internal logs are copied and any outstanding log transactions are not obfuscated if they contain names. xfs_metadump is a shell wrapper around the xfs_db(8) metadump command. SEE ALSO
xfs_repair(8), xfs_mdrestore(8), xfs_freeze(8), xfs_db(8), xfs_copy(8), xfs(5) BUGS
Email bug reports to xfs@oss.sgi.com. xfs_metadump(8)
All times are GMT -4. The time now is 11:01 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy