Reputation
590
Top tag
Next privilege 1,000 Rep.
See votes, expandable usercard
Badges
8 26
Impact
~60k people reached

Aug
23
suggested approved edit on Microsoft Exchange Management console, Initilization Failed
Aug
23
reviewed Reviewed Microsoft Exchange Management console, Initilization Failed
Aug
23
suggested approved 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 approved 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 approved edit on How to make Ubuntu Server 12.04 can send mail?
Aug
21
answered Bash script count down 5 minutes display on single line
Aug
20
comment enabling shell access for cyrus user
are there any security risks for this?
Aug
20
accepted Sync between two Mail Servers