Description of problem: [background info] > Both db2bak.pl and db2ldif.pl do not say much about where they are backing up or exporting. > ./db2ldif.pl -D "cn=Directory Manager" -w <pw> -n userRoot` > adding new entry cn=export_2007_3_19_11_1_38, cn=export, cn=tasks, cn=config > > ./db2bak.pl -D 'cn=Directory Manager' -w <pw> > adding new entry cn=backup_2007_3_19_11_14_51, cn=backup, cn=tasks, cn=config > > Isn't it nicer the perl scripts prints out something like "exporting to <fullpath>/<ldiffilename>" or "backing up to <backup_dir>" if it's not too noisy? Yes, they should print something like that. > > Maybe, we'd better add "backend name" to the path as well? E.g., laputa-userRoot_2007_3_19_11_14_51.ldif. Sure. [Fix proposal] db2bak.pl ========= ./db2bak.pl -D 'cn=Directory Manager' -w <pw> Back up directory: /opt/fedora-ds/slapd-laputa/bak/2007_3_19_14_18_17 adding new entry cn=backup_2007_3_19_14_18_17, cn=backup, cn=tasks, cn=config db2ldif.pl ========== 1) if suffixes are given, the first rdn values are added to the ldif file name following the server id separated by '-'s. ./db2ldif.pl -D 'cn=Directory Manager' -w <pw> -s dc=example,dc=com -s o=netscaperoot Exported ldif file: /opt/fedora-ds/slapd-laputa/ldif/laputa-example-netscaperoot-2007_3_19_14_18_7.ldif adding new entry cn=export_2007_3_19_14_18_7, cn=export, cn=tasks, cn=config 2) if backend instance names are given, the instance names are added to the ldif file name following the server id separated by '-'s. ./db2ldif.pl -D 'cn=Directory Manager' -w Secret123 -n userRoot -n netscapeRoot Exported ldif file: /opt/fedora-ds/slapd-laputa/ldif/laputa-userRoot-netscapeRoot-2007_3_19_14_18_14.ldif adding new entry cn=export_2007_3_19_14_18_14, cn=export, cn=tasks, cn=config note: if '-a' options are given to the both utilities, the specified path is used for the back up dir/ldif file.
Created attachment 150442 [details] cvs diff template-db2bak.pl.in template-db2ldif.pl.in Files: ldap/admin/src/scripts/template-db2bak.pl.in ldap/admin/src/scripts/template-db2ldif.pl.in Changes: db2bak.pl: print out the back up directory Back up directory: ... db2ldif.pl: print out the exported ldif file name Exported ldif file: ... The ldif file name format: <server id>-[<backend>}<first suffix value>]+-<date_time>.ldif
We may want to mention this ldif file name change in the doc...?
Created attachment 150443 [details] cvs commit message Reviewed by Rich (Thank you!) Checked in into HEAD.
Created attachment 150447 [details] cvs diff template-db2bak.in, template-db2bak.pl.in, template-db2ldif.in Files: ldap/admin/src/scripts/template-db2bak.in ldap/admin/src/scripts/template-db2bak.pl.in ldap/admin/src/scripts/template-db2ldif.in Changes: 1) Found db2bak, db2bak.pl, and db2ldif do not backup/export into the dir/file which do not start with the <server-id> string. It could cause the difficulty to find out which server instance does the backup/exported file belongs to. Also, to make them consistent with db2ldif.pl, added the "server id" string to the back up dir name/exported ldif file name. 2) db2ldif[.pl] takes -M option. With the -M option, the server adds backend name to the ldif file name. To reduce the redundancy, stopped adding the backend name if -M is set. 3) made the ldif file name db2ldif generates consistent with the one db2ldif.pl generates.
Created attachment 150451 [details] cvs commit message Thanks again for reviewing the changes, Rich. Checked in into HEAD.
Created attachment 150717 [details] cvs diff template-db2ldif.in File: ldap/admin/src/scripts/template-db2ldif.in Problem description: the command line fails to generate an output file name when an empty suffix is passed as follows: db2ldif -s "" Changes: check if the suffix is empty or not. If it is empty, generates an output file name without it.
Created attachment 150813 [details] cvs diff template-db2ldif.in and its commit message Reviewed by Rich (Thank you!) Checked in a slightly revised version into HEAD (removed redundant variable "nobe"...)
There's one more change needed for 'db2ldif -s ""' work... Index: template-db2ldif.in =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/admin/src/scripts/template-db2ldif.in,v retrieving revision 1.7 diff -t -w -U4 -r1.7 template-db2ldif.in --- template-db2ldif.in 24 Mar 2007 00:51:11 -0000 1.7 +++ template-db2ldif.in 29 Mar 2007 21:34:34 -0000 @@ -43,9 +43,11 @@ fi elif [ "$1" = "-M" ]; then be="" fi + if [ "$1" != "" ]; then shift + fi done if [ "$be" = "" ]; then echo {{LDIF-DIR}}/{{SERV-ID}}-`date +%Y_%m_%d_%H%M%S`.ldif
Created attachment 151242 [details] cvs commit message Reviewed by Nathan (Thank you!) Checked in into HEAD.