Sponsored Content
Top Forums Shell Programming and Scripting Comparing folders - autocopy script Post 302971117 by Don Cragun on Friday 15th of April 2016 07:27:04 PM
Old 04-15-2016
It would seem that after the line:
Code:
    $TRANSFER "$FILE" "$TARGET/$TIMESTAMP/$DATE"

you would want to run command something like:
Code:
    if ! cmp "$FILE" "$TARGET/$TIMESTAMP/$DATE" > /dev/null 2>&1
    then printf 'Attempt to copy file "%s" failed.\n' "$FILE"
    fi

presumably replacing the printf command with a call to logger. Instead of redirecting the cmp output to /dev/null you might want to save it in another file and also include the contents of that file with the data you send to logger.
This User Gave Thanks to Don Cragun For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

script to loop around folders

I have a folder called {homedata} Within this folder there are 12 subfolders 200601.......200612 Within each subfolder there are 8 sets of files Each filename commences with A B C D E F G or H, so {filename}* can be used. I am trying to write a script which will from the top level go... (2 Replies)
Discussion started by: grinder182533
2 Replies

2. Shell Programming and Scripting

listing folders and using in script

im a bit new to this and have been playing quite a bit and cant figure it out :( I have made a basic script: cd /folder/software1/bin/; echo "software1," >> /in/local/var/trace/davescripts/software.txt "\c"; ls -tm >> /in/local/var/trace/davescripts/software.txt; and this basically... (1 Reply)
Discussion started by: truCido
1 Replies

3. Shell Programming and Scripting

Comparing Two Binary Folders

I am a beginner to all of this but undertand the basic principles. I am currently working on a large task and struggling with a the final part. I have two files, folder 1 contains a list of around 20 files in binary (possibly treated as arrays?) folder 2 contains several files and sub... (2 Replies)
Discussion started by: puzzler
2 Replies

4. Shell Programming and Scripting

Apply script to several archives in several Folders.

Hello. I'm here again. I have a script in python and bash, and I need execute this script over all files in all folders. Example: Folder: CMDB Subfolders: router1 router2 switch1 switch2 and in this folders exists a file called... (3 Replies)
Discussion started by: bobbasystem
3 Replies

5. Ubuntu

Moving folders with script

Hi All, I am new to Forums, as i am struggling for one script i am launched here. I need to move more than 60,000+ folders in 1,00,000 folders to another server. I have the list of folders which should be moved. can anybody help me in sharing with the script for the above requirement. ... (4 Replies)
Discussion started by: ghimakiran
4 Replies

6. UNIX for Dummies Questions & Answers

Searching for folders/parent folders not files.

Hello again, A little while back I got help with creating a command to search all directories and sub directories for files from daystart of day x. I'm wondering if there is a command that I've overlooked that may be able to search for / write folder names to an output file which ideally... (2 Replies)
Discussion started by: Aussiemick
2 Replies

7. UNIX for Dummies Questions & Answers

script to create folders

hi again, having an issue with the code here because it doesnt work :D can someone point what and how to change, please. #!/bin/bash #create directory mylabs, inside create 6 directories named by user. DIR1="$1" DIR2="$2" if ; then echo -n " there is a folder named mylabs, what... (1 Reply)
Discussion started by: me.
1 Replies

8. Shell Programming and Scripting

Why is my bash script merging folders?

I hope this thread is in the right forum... This is for a .deb package that will be installed on Cydia. Pre'note': I am installing a custom 'hosts' file and AdSheet.app directory. My problem is during a reinstall/upgrade. Cydia will run the entire installation process again, which means it... (1 Reply)
Discussion started by: thazsar
1 Replies

9. Shell Programming and Scripting

Comparing two folders

Hi, Can you tell me how to compare two directories and write the differing files to some other folder? (5 Replies)
Discussion started by: arijitsaha
5 Replies

10. Shell Programming and Scripting

Help with Deleting Folders Script

Hi all new to the forums. Very beginner at shell scripting. What I'm trying to do is this: Is the directory empty prior to removal of it? If not, inform the user that the directory is not empty and if the user wants to remove it remove or move the files in it first. But I'm stuck.. It checks... (3 Replies)
Discussion started by: rduckett1456
3 Replies
Locale::Codes::LangFam(3)				User Contributed Perl Documentation				 Locale::Codes::LangFam(3)

NAME
Locale::Codes::LangFam - standard codes for language extension identification SYNOPSIS
use Locale::Codes::LangFam; $lext = code2langfam('apa'); # $lext gets 'Apache languages' $code = langfam2code('Apache languages'); # $code gets 'apa' @codes = all_langfam_codes(); @names = all_langfam_names(); DESCRIPTION
The "Locale::Codes::LangFam" module provides access to standard codes used for identifying language families, such as those as defined in ISO 639-5. Most of the routines take an optional additional argument which specifies the code set to use. If not specified, the default ISO 639-5 language family codes will be used. SUPPORTED CODE SETS
There are several different code sets you can use for identifying language families. A code set may be specified using either a name, or a constant that is automatically exported by this module. For example, the two are equivalent: $lext = code2langfam('apa','alpha'); $lext = code2langfam('apa',LOCALE_LANGFAM_ALPHA); The codesets currently supported are: alpha This is the set of three-letter (lowercase) codes from ISO 639-5 such as 'apa' for Apache languages. This is the default code set. ROUTINES
code2langfam ( CODE [,CODESET] ) langfam2code ( NAME [,CODESET] ) langfam_code2code ( CODE ,CODESET ,CODESET2 ) all_langfam_codes ( [CODESET] ) all_langfam_names ( [CODESET] ) Locale::Codes::LangFam::rename_langfam ( CODE ,NEW_NAME [,CODESET] ) Locale::Codes::LangFam::add_langfam ( CODE ,NAME [,CODESET] ) Locale::Codes::LangFam::delete_langfam ( CODE [,CODESET] ) Locale::Codes::LangFam::add_langfam_alias ( NAME ,NEW_NAME ) Locale::Codes::LangFam::delete_langfam_alias ( NAME ) Locale::Codes::LangFam::rename_langfam_code ( CODE ,NEW_CODE [,CODESET] ) Locale::Codes::LangFam::add_langfam_code_alias ( CODE ,NEW_CODE [,CODESET] ) Locale::Codes::LangFam::delete_langfam_code_alias ( CODE [,CODESET] ) These routines are all documented in the Locale::Codes::API man page. SEE ALSO
Locale::Codes The Locale-Codes distribution. Locale::Codes::API The list of functions supported by this module. http://www.loc.gov/standards/iso639-5/id.php ISO 639-5 . AUTHOR
See Locale::Codes for full author history. Currently maintained by Sullivan Beck (sbeck@cpan.org). COPYRIGHT
Copyright (c) 2011-2013 Sullivan Beck This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.16.3 2013-02-27 Locale::Codes::LangFam(3)
All times are GMT -4. The time now is 01:52 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy