bggo / Zmbkpose

The zmbkpose tool is a shell script that does hot backup and hot restore of ZCS Opensource accounts, GPL(OPENSOURCE). It can run from any host in the net, which means that it can be set on a backup server already existent.
http://wiki.zimbra.com/wiki/HOT_Backup_and_HOT_Restore
GNU General Public License v3.0
79 stars 56 forks source link

/usr/local/bin/zmbkpose: line 161: -x: command not found #30

Closed arekstuka closed 11 years ago

arekstuka commented 11 years ago

Hi Guys,

If i try to run cron from zimbra i have error: (Execute cron job aa ZIMBRA user)

Output from command zmbkpose -f ..

Running the parallel backup /usr/local/bin/zmbkpose: line 161: -x: command not found

p.s. if i use su - zimbra and than i type: zmbkpose -f backup was create successful.

Thx For help

Arek

liandros commented 11 years ago

2013/2/18 arekstuka notifications@github.com

Hi Guys,

If i try to run cron from zimbra i have error: (Execute cron job aa ZIMBRA user)

Output from command zmbkpose -f ..

Running the parallel backup /usr/local/bin/zmbkpose: line 161: -x: command not found

p.s. if i use su - zimbra and than i type: zmbkpose -f backup was create successful.

Thx For help

Arek

— Reply to this email directly or view it on GitHubhttps://github.com/bggo/Zmbkpose/issues/30.

I thing that you dont have the command ldapsearch, or it is not in you PATH. If you have installed ldap-tools, check your PATH variable in the definition of the cron ( Look for the /etc/crontab file to use for example ). And try the rewrite_proposal_v2.0 branch version. It is more configurable and complete version.

arekstuka commented 11 years ago

my path looks like this:

SHELL=/bin/sh PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

what i must add to this lines?

and could You send me more details about "rewrite_proposal_v2.0 branch version" ?

i alredy check links from this post: https://github.com/bggo/Zmbkpose/issues/21

and all links are have error 404...

OK, i just found it: https://github.com/bggo/Zmbkpose/tree/rewrite_proposal_v2.0

tomorrow i will check this version and i will let You know.

Thx

Arek

liandros commented 11 years ago

2013/2/18 arekstuka notifications@github.com

my path looks like this:

SHELL=/bin/sh PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

what i must add to this lines?

It is the standart PATH, and I think that is correct. According to the error : The /usr/local/bin/zmbkpose: line 161: -x: command not found I thnk that you are in 8dae5174f7 tree version of "master" branch, and If you look the line 161, you can see the follow: $(which ldapsearch) -x -H $LDAPMASTERSERVER -D $LDAPZIMBRADN -w $LDAPZIMBRAPASS -b '' -LLL "(objectclass=zimbraAccount)" zimbraMailDeliveryAddress zimbraMailHost | grep ^zimbraMail | awk '{print $2}' > "$LISTALLACCOUNTS" And if "which" not locate ldapsearch command, then bash execute a -x -H $LDAPMASTERSERVER ...... and it is your error. I suspect you are writing the cron line in a file created in /etc/cron.d directory, because there, are not valid the statements of /etc/crontab, and you should add a PATH declaration in it similar to /etc/crontab .

and could You send me more details about "rewrite_proposal_v2.0 branch version" ?

in proyect site : http://github.com/bggo/Zmbkpose there is a selection list says: [ brach:master ] , choose "rewrite_proposal_v2.0", and download the zip version.

arekstuka commented 11 years ago

Hi,

Thx for your support, i just install Your version rewrite_roposal, im usuing cron job from Webmin, and i did:

execute cron job as zimbra and type : zmbkpose -f -a admin@mydomain.com

and when i click on run button i received error:

Output from command zmbkpose -f -a admin@mydomain.com ..

ERROR:You dont have "ldapadd" command, or it is not in your PATH

in which file i must add PATH line? and what i must put there? i have ubuntu server 10.04.

thx

Arek

liandros commented 11 years ago

2013/2/21 arekstuka notifications@github.com

Hi,

Thx for your support, i just install Your version rewrite_roposal, im usuing cron job from Webmin, and i did:

execute cron job as zimbra and type : zmbkpose -f -a admin@mydomain.com

and when i click on run button i received error:

Output from command zmbkpose -f -a admin@mydomain.com ..

ERROR:You dont have "ldapadd" command, or it is not in your PATH

in which file i must add PATH line? and what i must put there? i have ubuntu server 10.04.

I suspect that webmin is the problem here. It is a high level interface to define cron jobs, but in these case, you need go to low. You should to find the created cron job file by webmin :

egrep zmbkpose -r /etc/cron*

Edit this file with your favorite editor, and add in the firsts lines (before the command zmbkpose) the follow : PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

arekstuka commented 11 years ago

Hi again, i install Your versiom, i use exactly this same files,and date from your instruction: 06 - Usage example when i run cron job , example : /usr/local/bin/zmbkpose.wrapper -F 20d -C 6h -c 400 -e 5s i received erron in log file:

You dont have "ldapadd" command, or it is not in your PATH ,

i dont know what im doing wrong....

thx for help

Arek

i just find problem....missing: ldap-utils , apt-get install ldap-utils and after i can run bacup crom cron, Only please let me know which user should be in cron job root ? or zimbra? example: 0 0 * * * zimbra /usr/local/bin/zmbkpose.wrapper -F 20d -C 6h -c 400 -e 5s

or:

0 0 * * * root /usr/local/bin/zmbkpose.wrapper -F 20d -C 6h -c 400 -e 5s

thx

Arek

liandros commented 11 years ago

2013/3/4 arekstuka notifications@github.com

Hi again, i install Your versiom, i use exactly this same files,and date from your instruction: 06 - Usage example when i run cron job , example : /usr/local/bin/zmbkpose.wrapper -F 20d -C 6h -c 400 -e 5s i received erron in log file:

You dont have "ldapadd" command, or it is not in your PATH ,

i dont know what im doing wrong....

1)you have installed ldap-tools ? What if you execute : $ ldapadd

2)If you have ldapadd command, then is a PATH problem in cron files. When cron executes jobs, the default PATH is "/usr/bin:/bin" accord the man page (man 5 crontab). You have installed ldaptools binaries an another dir. Show me the result of $ which ldapadd

arekstuka commented 11 years ago

THX for update but please check my latest wrote "

" i just find problem....missing: ldap-utils , apt-get install ldap-utils and after i can run bacup crom cron, Only please let me know which user should be in cron job root ? or zimbra? example: 0 0 * * * zimbra /usr/local/bin/zmbkpose.wrapper -F 20d -C 6h -c 400 -e 5s

or:

0 0 * * * root /usr/local/bin/zmbkpose.wrapper -F 20d -C 6h -c 400 -e 5s

thx

Arek "

liandros commented 11 years ago

2013/3/5 arekstuka notifications@github.com

THX for update but please check my latest wrote "

" i just find problem....missing: ldap-utils , apt-get install ldap-utils and after i can run bacup crom cron,

Great!!

Only please let me know which user should be in cron job root ? or zimbra? example: 0 0 * * * zimbra /usr/local/bin/zmbkpose.wrapper -F 20d -C 6h -c 400 -e 5s

or:

0 0 * * * root /usr/local/bin/zmbkpose.wrapper -F 20d -C 6h -c 400 -e 5s

thx

You are free to choose, but I suggest use zimbra user. From a security aspect, it is best to use as little as possible root user. But remember to give the zimbra user, permissions to write on the directory backups (WORKDIR in /etc/zmbkpose.conf) . Please keep me informed of your suggestions or problems so I can fix them.

arekstuka commented 11 years ago

No Problem i will let You know if something is not working good....i start testing your script from yesterday...i need time to check everything...... Do You have some instruction to restore email's from backup?

Thx Arek

liandros commented 11 years ago

2013/3/5 arekstuka notifications@github.com

No Problem i will let You know if something is not working good....i start testing your script from yesterday...i need time to check everything...... Do You have some instruction to restore email's from backup?

No. I will should write it . You can use -r or -R . There is a minimal explication when you execute zmbkpose without arguments.

arekstuka commented 11 years ago

If i want restore example from full backup acount admin@admin.com i need use zmbkpose -R admin@admin.com ? or something else?

liandros commented 11 years ago

2013/3/5 arekstuka notifications@github.com

If i want restore example from full backup acount admin@admin.com i need use zmbkpose -R admin@admin.com ? or something else?

— Reply to this email directly or view it on GitHubhttps://github.com/bggo/Zmbkpose/issues/30#issuecomment-14444831 .

Suppose that you have the follows FULL/INCREMENTAL account backups : Monday : Backup FULL Tuesday : Backup INC Wednesday: Backup FULL Thursday : Backup INC Friday : Backup INC

If you restore using $ zmbkpose -r -a admin@admin.com then you are restauring from last full backup, and subsequent incrementals: backups from wednesday, thursday and friday.

If It's saturday and restore using $ zmbkpose -R 2d -a admin@admin.com then you are restauring from last full backup, and subsequent incrementals upto reach now - 2 days (saturday - 2 day) : backups from wednesday and thursday

If It's saturday and restore using $ zmbkpose -R 4d -a admin@admin.com then you are restauring from last full backup(previous to now - 4 days), and subsequent incrementals upto reach now - 4 days (saturday - 4 day) : backups from monday and tuesday

sanjivbjoshi commented 9 years ago

I have installed Zmbkpose-rewrite_proposal_v2.0. Everything working fine except one thing and it is zmbkpose -backupdistributionlist command not working for backup all distribution list. So can you help me how to take backup of all distribution list. Already I have tried with following command zmbkpose -backupdistributionlist, zmbkpose --backupdistributionlist, zmbkpose -f -backupdistributionlist, zmbkpose -f --backupdistributionlist.