537 reputation
320
bio website 127.0.0.1
location Mumbai, India
age 27
visits member for 2 years, 5 months
seen Jul 7 at 7:30

Sysadmin leaning towards *nix, avid fan of the DC Universe, amateur programmer who's learning Python at the moment (and regex gives me nightmares). Oh, and I am a foodie extraordinaire ;)

I am nerdier than 99% of all people. Are you a nerd? Click here to take the Nerd Test, get nerdy images and jokes, and write on the nerd forum!


Aug
23
reviewed No Action Needed Why does my local network transfer speed decrease with larger files?
Aug
23
reviewed No Action Needed yum and command line field
Aug
23
reviewed Reviewed Microsoft Exchange Management console, Initilization Failed
Aug
23
suggested suggested edit on Microsoft Exchange Management console, Initilization Failed
Aug
23
reviewed Reviewed Microsoft Exchange Management console, Initilization Failed
Aug
23
suggested suggested edit on Microsoft Exchange Management console, Initilization Failed
Aug
23
accepted enabling shell access for cyrus user
Aug
23
revised inotify in bash script doesn't work with ldapadd command
made changes that reflect the correct answer which worked
Aug
23
accepted inotify in bash script doesn't work with ldapadd command
Aug
23
suggested suggested edit on inotify in bash script doesn't work with ldapadd command
Aug
23
comment inotify in bash script doesn't work with ldapadd command
the ldif file was copied from the remote machine to the current machine via scp (and named with extension .tmp). Then the script in the current machine removes the .tmp extention (using mv) and then runs ldapadd; In essence two scripts - one on the remote machine to generate the ldif and copy it here and the second one on the current machine to add it to the LDAP directory.
Aug
23
comment inotify in bash script doesn't work with ldapadd command
Copying to user.ldif.tmp, then moving to user.ldif worked!! :) Phew!! Thanks mindthemonkey and @Iain - I learnt some new things today... Could you edit the answer so that I can accept it please?
Aug
23
comment inotify in bash script doesn't work with ldapadd command
The above code doesn't give any output (cat $ldf). I am trying your suggestion of a temp file as we speak.
Aug
23
comment inotify in bash script doesn't work with ldapadd command
yes. Also, if I run the script without the while inotifywait..., it adds the ldap entry successfully.
Aug
23
comment inotify in bash script doesn't work with ldapadd command
The other commands like echo, rm, cp, mv and ls (these are the ones I tried) work within the while loop. As far as writing to the file is concerned, the file in it's entirety is being copied from another machine directly into this location.
Aug
23
comment inotify in bash script doesn't work with ldapadd command
Ok. This is the output after including set -x - ldapadd -w ldappassword -D cn=Manager,dc=mydomain,dc=com -f /home/myuser/newldif/user.ldif - For some reason, the quotes around the password and the rootdn have been removed. Is that what is causing it to skip the ldapadd command?
Aug
23
comment inotify in bash script doesn't work with ldapadd command
@Iain - #!/bin/bash is already the first line of the script. Where do I add the set -x?
Aug
23
asked inotify in bash script doesn't work with ldapadd command
Aug
21
revised How to make Ubuntu Server 12.04 can send mail?
Grammar and spelling
Aug
21
suggested suggested edit on How to make Ubuntu Server 12.04 can send mail?