Sponsored Content
Top Forums Shell Programming and Scripting check for file existance and generate exit code amd move to another directory Post 302662533 by Corona688 on Tuesday 26th of June 2012 04:52:09 PM
Old 06-26-2012
So... if the file exists, don't move it, but if it doesn't exist, do? Smilie
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Move command return with exit code of 2

I have a script which loads data files into Oracle and then moves each file into a 'processed' directory when each file has finished loading. Last night I found that the script was failing on the mv statement (with a return code 2) and the following message, mv: cannot access... (1 Reply)
Discussion started by: handak9
1 Replies

2. Shell Programming and Scripting

check the file existance

Hello, I have two files .. 1. inventory_i.txt 2. inventory_b.txt I want to check if these two files exists. If exists, then do the process, otherwise, quite... if ; then echo "exists" else echo " does not exists" fi The above logic is not working... It is always, displaying Does... (2 Replies)
Discussion started by: govindts
2 Replies

3. Shell Programming and Scripting

Move a file from windows directory to unix directory

Move a file from windows directory to unix directory, is this possible? if it is, can someone help me on this? Thanks! God bless! (1 Reply)
Discussion started by: kingpeejay
1 Replies

4. Shell Programming and Scripting

Move the latest or older File from one directory to another Directory

I Need help for one requirement, I want to move the latest/Older file in the folder to another file. File have the datetimestamp in postfix. Example: Source Directory : \a destination Directory : \a\b File1 : xy_MMDDYYYYHHMM.txt (xy_032120101456.txt) File2: xy_MMDDYYYYHHMM.txt... (1 Reply)
Discussion started by: pp_ayyanar
1 Replies

5. Shell Programming and Scripting

Scripting to check the size of file and it's existance.

Hi, I am totaly new to create a script . Please help. I have file name retrived from SAP table into a internal table . Like :- /home/td_8d02_int_data_IPCL/ILLUSTRATIONS/CGM/l_pc_112138_01_0_01_00.cgm /home/td_8d02_int_data_IPC-L/ILLUSTRATIONS/CMP/l_pc_112138_01_0_01_00.cmp Objective... (1 Reply)
Discussion started by: amitkumar.b2
1 Replies

6. Shell Programming and Scripting

how to check existance of multiple directories

Hi, I would like to check whether all the directories exists or not. I tried the below but it gives some error. below is the excerpt from my original script 24 #Check if the required directories are exists 25 dirExists() { 26 27 if 28 then 29 echo "required... (1 Reply)
Discussion started by: lookinginfo
1 Replies

7. Shell Programming and Scripting

Csh/tcsh : Check the file existance and run the script

Hi, I've to wait until a file generated and once its generated, source another script in Linux terminal. Please help me as this is very very urgent. The code should be something like if ( -e "/abc/xyz/a.txt ) source aaa.csh else sleep This should be repeated till the if... (4 Replies)
Discussion started by: kumar_eee
4 Replies

8. UNIX for Beginners Questions & Answers

Check output of command before outputing and keep exit code

so i have scripts that are piped and then run through one of the following mechanisms: cat myscript.sh | sh cat myscript.pl | perl what i want to do is, after either of the above commands are run, if the output from the command contains a certain string, i want it to avoid printing... (3 Replies)
Discussion started by: SkySmart
3 Replies

9. Shell Programming and Scripting

Shell script cannot create directory and move the file to that directory

I have a script, which is checking if file exists and move it to another directory if then mkdir -p ${LOCL_FILES_DIR}/cool_${Today}/monthly mv report_manual_alloc_rpt_A_I_ASSIGNMENT.${Today}*.csv ${LOCL_FILES_DIR}/cool_${Today}/monthly ... (9 Replies)
Discussion started by: digioleg54
9 Replies

10. UNIX for Beginners Questions & Answers

Check for files and move it to another directory - ksh

I'm trying to wirte ksh script for given requirement, but i unable to achive it. In dir1 directory I need to check for the files which suffixed with .csv or .txt, If there is no files, then i need to exit. If any files found I need to move the each file found to dir2 directory. I have to repeat... (4 Replies)
Discussion started by: Kayal
4 Replies
ipa-ldap-updater(1)						 IPA Manual Pages					       ipa-ldap-updater(1)

NAME
ipa-ldap-updater - Update the IPA LDAP configuration SYNOPSIS
ipa-ldap-updater [options] input_file(s) ipa-ldap-updater [options] DESCRIPTION
ipa-ldap-updater is used to apply updates to the IPA LDAP server when the IPA packages are being updated. It is not intended to be executed by end-users. When run with no file arguments, ipa-ldap-updater will process all files with the extension .update in /usr/share/ipa/updates. An update file describes an LDAP entry and a set of operations to be performed on that entry. It can be used to add new entries or modify existing entries. Blank lines and lines beginning with # are ignored. There are 7 keywords: * default: the starting value * add: add a value (or values) to an attribute * remove: remove a value (or values) from an attribute * only: set an attribute to this * onlyifexist: set an attribute to this only if the entry exists * deleteentry: remove the entry * replace: replace an existing value, format is old: new * addifnew: add a new attribute and value only if the attribute doesn't already exist. Only works with single-value attributes. * addifexist: add a new attribute and value only if the entry exists. This is used to update optional entries. Values is a comma-separated field so multi-values may be added at one time. Double or single quotes may be put around individual values that contain embedded commas. The difference between the default and add keywords is if the DN of the entry exists then default is ignored. So for updating something like schema, which will be under cn=schema, you must always use add (because cn=schema is guaranteed to exist). It will not re-add the same information again and again. It alsos provide some things that can be templated such as architecture (for plugin paths), realm and domain name. The available template variables are: * $REALM - the kerberos realm (EXAMPLE.COM) * $FQDN - the fully-qualified domain name of the IPA server being updated (ipa.example.com) * $DOMAIN - the domain name (example.com) * $SUFFIX - the IPA LDAP suffix (dc=example,dc=com) * $ESCAPED_SUFFIX - the ldap-escaped IPA LDAP suffix * $LIBARCH - set to 64 on x86_64 systems to be used for plugin paths * $TIME - an integer representation of current time A few rules: 1. Only one rule per line 2. Each line stands alone (e.g. an only followed by an only results in the last only being used) 3. adding a value that exists is ok. The request is ignored, duplicate values are not added 4. removing a value that doesn't exist is ok. It is simply ignored. 5. If a DN doesn't exist it is created from the 'default' entry and all updates are applied 6. If a DN does exist the default values are skipped 7. Only the first rule on a line is respected Adds and updates are applied from shortest to longest length of DN. Deletes are done from longest to shortest. OPTIONS
-d, --debug Enable debug logging when more verbose output is needed -t, --test Run through the update without changing anything. If changes are available then the command returns 2. If no updates are available it returns 0. -y File containing the Directory Manager password -l, --ldapi Connect to the LDAP server using the ldapi socket -p, ---plugins Execute update plugins as well as any update files. There is no way to execute only the plugins. -u, ---upgrade Upgrade an installed server in offline mode (implies --ldapi and --plugins) -W, ---password Prompt for the Directory Manager password EXIT STATUS
0 if the command was successful 1 if an error occurred 2 if run with in test mode (-t) and updates are available IPA
Sep 12 2008 ipa-ldap-updater(1)
All times are GMT -4. The time now is 08:39 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy