Sponsored Content
Top Forums Shell Programming and Scripting Comparing two directories with diff Post 303028582 by Chubler_XL on Thursday 10th of January 2019 04:00:26 PM
Old 01-10-2019
As Stomp mentioned before rsync is a good match for this type of problem.

It offers a --dry-run option that allows reporting on any differences and what would be done to update them. It has many configuration options for example: supports just comparing filenames+date+time or doing a full CRC check of each file, removing files no longer present on the master server, compressing data as it's transferred between the servers, bandwidth capping for reduction on network impact, preserving file ownership and permissions, etc.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

perl package directories - what if the script is diff DIR to the one contain *.pm?

Hi there, say the package is in the ~/ and it's ~/packageFoo.pm I can use usePackage.pl in ~/ (~/usePackage.pl). Now, if I move it to ~/subDIR/usePackage.pl, the script won't work because it's not in the same DIR with packageFoo.pm How can i fix it? Thanks Gusla (1 Reply)
Discussion started by: gusla
1 Replies

2. UNIX for Dummies Questions & Answers

perform diff between 2 directories

Hello all i wander what is the best way to make diff between 2 directories and perform diff of 2 kinds the first is the names of the files on each directory , and the second diff is between the content of each file and the corresponding file and the second dir. Thanks for the help (5 Replies)
Discussion started by: umen
5 Replies

3. UNIX for Dummies Questions & Answers

Compare/Diff between directories and subdirectories?

Hi, Does anybody know the cmd to compare two areas and print out the different files w/ path? I tried cmp and diff and dircmp but with no luck. Should I grep and print? For example: /aa/images/jan ..../images/feb /bb/images/jan ..../images/feb i want to print the compare,... (5 Replies)
Discussion started by: andylee80
5 Replies

4. UNIX for Dummies Questions & Answers

Using diff on files in different directories

Hi, I want to be able to compare two different files in two different directories. I have a development server set up on one domain and a live server set up on another.....I need to be able to compare files on these two servers. Any ideas? (2 Replies)
Discussion started by: elduderino
2 Replies

5. UNIX and Linux Applications

CVS recursive diff -- how to exclude specific directories?

I think I've seen out there that there is a command to ignore specific files within a directory when doing a (-R) recursive diff. I've never used this so I was wondering if there was anyone who could provide an example how I would run this. My thoughts are something like: cvs diff -i <fileName1>... (2 Replies)
Discussion started by: airon23bball
2 Replies

6. Homework & Coursework Questions

comparing 2 directories

i have been asked to write a bash shell script comparing two directories and sed or awk should not be used in this assignment. compdir will compare filenames in two directories, and list information about filenames that are in one directory but not the other. The information listed will be a long... (1 Reply)
Discussion started by: soccerball
1 Replies

7. UNIX for Dummies Questions & Answers

Help regarding effective usage of diff for comparing files

Help regarding effective usage of diff for comparing files Hi All, I have few doubts regarding best usage of diff command. I also have some questions with out put of diff command. File1: ABC DEF File2: ABC DEFAA diff file1 file2 2c2 <DEF ----- (1 Reply)
Discussion started by: sarbjit
1 Replies

8. UNIX for Dummies Questions & Answers

Change chmod on files in diff directories

I am looking for a small script to crawl through several directories and change a couple of files in each directory to read write status. Anyone have any ideas ? (5 Replies)
Discussion started by: zapper222
5 Replies

9. Shell Programming and Scripting

Comparision of two directories of diff servers

Hi All, I have transferred some directory structures from server1 to server2 by creating a tar files. Now i need to cross check whether I transferred entire structures or not. Is there any command to check this on each individual server. Thanks (2 Replies)
Discussion started by: nag_sathi
2 Replies

10. Shell Programming and Scripting

Help with create multiple directories under diff file systems

Hi, Need help ...I want to create multiple directories in different /file systems using for loop..eg.../ORCL_data01/oradata/orcl/ctl. ../ORCL_data01/oradata/orcl/data. ../ORCL_data01/oradata/orcl/redo. Script :- ========= for dir in `ls -d... (8 Replies)
Discussion started by: Linux6.5
8 Replies
DIRVISH(8)						      System Manager's Manual							DIRVISH(8)

NAME
dirvish - Disk based virtual image network backup system SYNOPSIS
dirvish --vault vault [ OPTIONS ] DESCRIPTION
Create a backup image of a client directory tree. Each image is a directory containing transfer log, summary, tree and if transfer errors were detected an rsync_error file. The transfer log retains the the output of any pre and post processing commands and the rsync log listing all files that were changed or added with some statistical information. The summary file contains all the information about how the image was created and meta-data for managing the image in config file format. Tree is the copy of the client tree. The client directory tree is compared with an existing image to create a new image. Unchanged files are shared between images. For changed files only those parts that actually change are transfered over the network. Unchanged portions of files are copied from the ref- erence image. The resulting images contain complete copies of the original trees preserving ownership and file permissions. In this way even though the backups are made incrementally, each image can be used independently for restores or to make removable-media off-site copies or archives. The removal of an image will have no effect on other images. OPTIONS
Each option on the command line may be specified any number of times. Those options that support lists in the config files will accumulate all of their arguments otherwise each specification will override the ones before. As configuration files are loaded they may override options on the command line. Each option may be unambiguously abbreviated. --branch [vault:]branch_name Specify a branch to use. A branch is a sequence of images. If a vault has been specified either here or with --vault the first time this option is used it will attempt to load the config file branch_name or branch_name.conf from the vault. --config config-file Load options from the specified file. If this precedes --vault the --vault option will not load it's own config file. If vault has been set and config-file is a bare filename the presence of one in the vault will take precedence over one in the cur- rent directory. To specify one in the current directory after --vault use ./ to precede the name. The master configuration file will be read prior to processing options. --expire expire_date Specify a time for the image to expire. See Time::ParseDate(3pm) for details. This does not actually expire anything. What it does do is add an Expire: field to the image summary file containing an absolute time so that a dirvish-expire or another tool outside of dirvish can decide when to remove old images. --image image_name Specify a name for the image. image_name is passed through POSIX::strftime See strftime(3) for details. --image-time parsedate_expression Time to use when creating the image name. If an absolute time without a date is provided it will be forced into the past. If this isn't set the current time will be used. See Time::ParseDate(3pm) for details. --init Create an initial image. Create the image entirely from the source tree without the use of a reference image. --no-run --dry-run Don't actually do anything. Process all configuration files, options and tests then produce a summary/configuration file on standard output and exit. --reference branch_name|image_name Specify an existing image or a branch from which to create the new image. If a branch_name is specified, the last existing image from its history file will be used. A branch will take precedence over an image of the same name. --reset option Reset the values in an accumulating option. --summary short|long Specify summary format. A short summary will only include final used values. A long summary will include all configuration values. Default value: short --vault vault[:branch_name] Specify the vault to store the image in. If not preceeded by --config this will attempt to load the config file default or default.conf within the vault. If branch_name is specified here this will behave exactly like the --branch option and branch_name or branch_name.conf will be attempted instead of default.conf. --version Print version string and exit. EXIT CODES
To facilitate further automation and integration of dirvish with other tools dirvish provides rationalised exit codes. The exit codes are range based. While the code for a specific error may change from one version to another it will remain within the specified range. So don't test for specific exit codes but instead test for a range of values. To the degree possible higher value ranges indicate more severe errors. 0 success 1-19 The backup job reported warnings. 20-39 An error occurred during index generation and cleanup. 40-49 A post-client or post-server command could not be run. 50-59 The post-client command reported an error. Its exit code modulo 10 is added to 50 60-69 The post-server command reported an error. Its exit code modulo 10 is added to 60 70-79 A post-client or post-server command could not be run. 80-89 The pre-server command reported an error. Its exit code modulo 10 is added to 80 90-99 The pre-server command reported an error. Its exit code modulo 10 is added to 90 100-149 Rsync encountered a non-fatal error. 150-199 Rsync encountered a fatal error. 200-219 An error was encountered in loading a configuration file. 220-254 An error was detected in the configuration. 255 Incorrect usage. FILES
/etc/dirvish/master.conf alternate master configuration file. /etc/dirvish.conf master configuration file. /etc/dirvish/client[.conf] client configuration file. bank/vault/dirvish/default[.conf] default vault configuration file. bank/vault/dirvish/branch[.conf] branch configuration file. bank/vault/dirvish/branch.hist branch history file. bank/vault/image/summary image creation summary. bank/vault/image/log image creation log. bank/vault/image/tree actual image of source directory tree. bank/vault/image/rsync_error Error output from rsync if errors or warnings were detected. SEE ALSO
dirvish.conf(5) dirvish-runall(8) dirvish-expire(8) dirvish-locate(8) ssh(1) rsync(1) Time::ParseDate(3pm) strftime(3) AUTHOR
Dirvish was created by J.W. Schultz of Pegasystems Technologies. BUGS AND ISSUES
Fields set in configuration files will override command line options that have been set before the file is read. This behaviour while con- sistent may occasionally confuse. For this reason most command line options should be specified after any options that may cause a config- uration file to be loaded. In order to preserve permissions it is necessary for dirvish to run as root on the backup server. The root user must have non-interactive ssh access to the client systems. It is not necessary that this access be as the root user on the client. File ownership is preserved using numeric values so it is not necessary to have user accounts on the backup server. Making the vaults net- work accessible using protocols that map UIDs based on names instead of number could allow access controls on files to be violated. Making the vaults writable by users will compromise the integrity of the backups. Therefore any access to the vaults by users should be done through a read-only mount. DIRVISH(8)
All times are GMT -4. The time now is 04:01 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy