Reputation
573
Top tag
Next privilege 1,000 Rep.
See votes, expandable usercard
Badges
5 24
Impact
~46k people reached

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
Aug
20
asked enabling shell access for cyrus user
Aug
19
accepted Reconstructing cyrus mailboxes with sub-folders
Aug
19
comment Reconstructing cyrus mailboxes with sub-folders
Ok. I ran reconstruct -rf user/testuser and it created the sub-folders as you said. But all the mails are unread in the sub-folders..
Aug
19
asked Reconstructing cyrus mailboxes with sub-folders
Aug
16
comment Getting the LDAP password from the LDAP Directory
While I agree that yours is the more efficient way, and ultimately that is what we want to achieve, we're just trying this method out before we get to a master-slave setup
Aug
16
accepted Getting the LDAP password from the LDAP Directory