[GH-ISSUE #162] Backup single account error #127

Open
opened 2026-02-27 08:14:29 +03:00 by kerem · 15 comments
Owner

Originally created by @maximishchenko on GitHub (May 18, 2021).
Original GitHub issue: https://github.com/lucascbeyeler/zmbackup/issues/162

Hi.
I am got an error, when try to backup single mailbox

[zimbra@mail bash]$ zmbackup -f -m -a my@example.com
/usr/local/lib/zmbackup/bash/BackupAction.sh: строка 100: my@example.com//,/\n/g: No such file or directory
Nothing to do. Closing...

How can i make backup of single account or list of accounts?

Originally created by @maximishchenko on GitHub (May 18, 2021). Original GitHub issue: https://github.com/lucascbeyeler/zmbackup/issues/162 Hi. I am got an error, when try to backup single mailbox [zimbra@mail bash]$ zmbackup -f -m -a my@example.com /usr/local/lib/zmbackup/bash/BackupAction.sh: строка 100: my@example.com//,/\n/g: No such file or directory Nothing to do. Closing... How can i make backup of single account or list of accounts?
Author
Owner

@killmasta93 commented on GitHub (Jun 22, 2021):

run this to backup only one email

zmbackup -f -a email@domain.com

<!-- gh-comment-id:866384199 --> @killmasta93 commented on GitHub (Jun 22, 2021): run this to backup only one email `zmbackup -f -a email@domain.com`
Author
Owner

@maximishchenko commented on GitHub (Jun 23, 2021):

I still get the error

	[root@mail ~]# su zimbra
	[zimbra@mail root]$ zmbackup -f -a my@example.com
	/usr/local/lib/zmbackup/bash/BackupAction.sh: string 100: my@example.com//,/\n/g: Access denied
	Nothing to do. Closing...

<!-- gh-comment-id:866562556 --> @maximishchenko commented on GitHub (Jun 23, 2021): I still get the error ``` [root@mail ~]# su zimbra [zimbra@mail root]$ zmbackup -f -a my@example.com /usr/local/lib/zmbackup/bash/BackupAction.sh: string 100: my@example.com//,/\n/g: Access denied Nothing to do. Closing... ```
Author
Owner

@killmasta93 commented on GitHub (Jun 24, 2021):

can you show me output of

cat /etc/zmbackup/zmbackup.conf

<!-- gh-comment-id:867317848 --> @killmasta93 commented on GitHub (Jun 24, 2021): can you show me output of ` cat /etc/zmbackup/zmbackup.conf `
Author
Owner

@maximishchenko commented on GitHub (Jun 24, 2021):

[root@mail ~]# cat /etc/zmbackup/zmbackup.conf
###############################################################################

ZMBACKUP CONFIGURATION FILE

###############################################################################

This file is used to manage the behavior of the zmbackup. Please edit with

cautious this file. All the values are configured by the zmbackup_wizard, but

you can change them if you need, just avoid remove any parameter from this file.

To regenerate this file, just execute zmbackup_wizard again.

WARNING - There is a field called DEFAULT. This is not the default value of the

field. It's just a reminder if you forgot the original value of the field.

###############################################################################

BACKUPUSER - Used to store the name of the account used by Zimbra server to start

and stop the service.

DEFAULT: zimbra

BACKUPUSER=zimbra

WORKDIR - Used to store the backups and where the sessions.txt will be saved.

The directory must have as owner the same value as BACKUPUSER.

DEFAULT: /opt/zimbra/backup

WORKDIR=/opt/zimbra/backup

LDAPSERVER - This is the address where you stored Zimbra's LDAP server in your

environment.

DEFAULT: 127.0.0.1

LDAPSERVER=ldap://10.10.10.10:389

LDAPADMIN - This is where you inform the ldap admin account to backup and restore

accounts, alias, and distribution lists entries.

DEFAULT: uid=zimbra,cn=admins,cn=zimbra

LDAPADMIN=uid=zimbra,cn=admins,cn=zimbra

LDAPPASS - This is where you inform the ldap admin password to backup and restore

accounts, alias, and adistribuition lists entries.

LDAPPASS=pwd

LOGFILE - The path where zmbackup will save his logs. Don't confuse with sessions.txt.

Sessions.txt is hard coded stored in $WORKDIR.

DEFAULT: /opt/zimbra/log/zmbackup.log

LOGFILE=/opt/zimbra/log/zmbackup.log

ENABLE_EMAIL_NOTIFY - Enable or disable mail notification during a backup routine.

OPTIONS:

- all: Enable all the mail notification

- start: Enable only the start mail notification

- finish: Enable only the finish mail notification

- error: Enable only for error messages

- none: Disable mail notification

DEFAULT: all

ENABLE_EMAIL_NOTIFY=all

EMAIL_NOTIFY - After each zmbackup execution, going everything okay or not, a mail

is sended to someone to inform that the process is concluded, and

show a report of each account backed up.

EMAIL_NOTIFY=my@example.com

EMAIL_SENDER - Inform with which e-mail account Zmbackup should use to send the

message.

DEFAULT: root@domain

EMAIL_SENDER=

MAX_PARALLEL_PROCESS - Here you define how many process zmbackup will use to complete

its tasks. If you want to keep as single thread, configure

this field with the value 1.

DEFAULT: 3

MAX_PARALLEL_PROCESS=3

ROTATE_TIME - Here you define how many days zmbackup must keep in their archives.

This value affect full, incremental, alias and distribution list backups.

DEFAULT: 30

ROTATE_TIME=30

LOCK_BACKUP - Here you define if zmbackup should lock the backup session for only one

for each day for each option.

DEFAULT: true

LOCK_BACKUP=true

SESSION_TYPE - This option define the default place where zmbackup should store the

information of each session. Valid values can be TXT - for session.txt

- or SQLITE3 - for SQLite3 driver.

DEFAULT: TXT

SESSION_TYPE=SQLITE3

BACKUP_INACTIVE_ACCOUNTS - Enable this option to Zmbackup backup disabled accounts too.

DEFAULT: true

BACKUP_INACTIVE_ACCOUNTS=true

SSL_ENABLE - Enable SSL communication between Zmbackup and your Zimbra Server.

DEFAULT: true

SSL_ENABLE=true

ZMMAILBOX - Location for the zmmailbox binary.

DEFAULT: /opt/zimbra/bin/zmmailbox

<!-- gh-comment-id:867345380 --> @maximishchenko commented on GitHub (Jun 24, 2021): [root@mail ~]# cat /etc/zmbackup/zmbackup.conf ############################################################################### # ZMBACKUP CONFIGURATION FILE # ############################################################################### # This file is used to manage the behavior of the zmbackup. Please edit with # cautious this file. All the values are configured by the zmbackup_wizard, but # you can change them if you need, just avoid remove any parameter from this file. # To regenerate this file, just execute zmbackup_wizard again. # WARNING - There is a field called DEFAULT. This is not the default value of the # field. It's just a reminder if you forgot the original value of the field. ############################################################################### # BACKUPUSER - Used to store the name of the account used by Zimbra server to start # and stop the service. # DEFAULT: zimbra BACKUPUSER=zimbra # WORKDIR - Used to store the backups and where the sessions.txt will be saved. # The directory must have as owner the same value as BACKUPUSER. # DEFAULT: /opt/zimbra/backup WORKDIR=/opt/zimbra/backup # LDAPSERVER - This is the address where you stored Zimbra's LDAP server in your # environment. # DEFAULT: 127.0.0.1 LDAPSERVER=ldap://10.10.10.10:389 # LDAPADMIN - This is where you inform the ldap admin account to backup and restore # accounts, alias, and distribution lists entries. # DEFAULT: uid=zimbra,cn=admins,cn=zimbra LDAPADMIN=uid=zimbra,cn=admins,cn=zimbra # LDAPPASS - This is where you inform the ldap admin password to backup and restore # accounts, alias, and adistribuition lists entries. LDAPPASS=pwd # LOGFILE - The path where zmbackup will save his logs. Don't confuse with sessions.txt. # Sessions.txt is hard coded stored in $WORKDIR. # DEFAULT: /opt/zimbra/log/zmbackup.log LOGFILE=/opt/zimbra/log/zmbackup.log # ENABLE_EMAIL_NOTIFY - Enable or disable mail notification during a backup routine. # OPTIONS: # - all: Enable all the mail notification # - start: Enable only the start mail notification # - finish: Enable only the finish mail notification # - error: Enable only for error messages # - none: Disable mail notification # DEFAULT: all ENABLE_EMAIL_NOTIFY=all # EMAIL_NOTIFY - After each zmbackup execution, going everything okay or not, a mail # is sended to someone to inform that the process is concluded, and # show a report of each account backed up. EMAIL_NOTIFY=my@example.com # EMAIL_SENDER - Inform with which e-mail account Zmbackup should use to send the # message. # DEFAULT: root@domain EMAIL_SENDER= # MAX_PARALLEL_PROCESS - Here you define how many process zmbackup will use to complete # its tasks. If you want to keep as single thread, configure # this field with the value 1. # DEFAULT: 3 MAX_PARALLEL_PROCESS=3 # ROTATE_TIME - Here you define how many days zmbackup must keep in their archives. # This value affect full, incremental, alias and distribution list backups. # DEFAULT: 30 ROTATE_TIME=30 # LOCK_BACKUP - Here you define if zmbackup should lock the backup session for only one # for each day for each option. # DEFAULT: true LOCK_BACKUP=true # SESSION_TYPE - This option define the default place where zmbackup should store the # information of each session. Valid values can be TXT - for session.txt # - or SQLITE3 - for SQLite3 driver. # DEFAULT: TXT SESSION_TYPE=SQLITE3 # BACKUP_INACTIVE_ACCOUNTS - Enable this option to Zmbackup backup disabled accounts too. # DEFAULT: true BACKUP_INACTIVE_ACCOUNTS=true # SSL_ENABLE - Enable SSL communication between Zmbackup and your Zimbra Server. # DEFAULT: true SSL_ENABLE=true # ZMMAILBOX - Location for the zmmailbox binary. # DEFAULT: /opt/zimbra/bin/zmmailbox
Author
Owner

@killmasta93 commented on GitHub (Jun 25, 2021):

could you reinstall zmbackup

first uninstall it

running the script install.sh with -r

apt-get install cifs-utils
apt-get install parallel wget httpie sqlite3
git clone -b 1.2-3 https://github.com/lucascbeyeler/zmbackup.git
 cd zmbackup
./install.sh

You will get a certain of questions answer the following

Inform Zimbra's defaut user - DEFAULT [zimbra]:

Inform Zimbra's defaut install path - DEFAULT [/opt/zimbra]:

Inform the path Zmbackup will use to store - DEFAULT [/opt/zimbra/backup]:

Inform the account to receive all Zmbackup's alerts - DEFAULT [admin@xxxx:

Inform Zmbackup's number of threads - DEFAULT [3]:

Inform the number of days Zmbackup should store the backups - DEFAULT [30]:

Zmbackup should limit backups for one per day? - DEFAULT [true]:false

Where you want to store Zmbackup's sessions? TXT or SQLITE3 - DEFAULT [TXT]:

Inform a password for zmbackup user - DEFAULT [OTx]:

<!-- gh-comment-id:868524343 --> @killmasta93 commented on GitHub (Jun 25, 2021): could you reinstall zmbackup first uninstall it `running the script install.sh with -r` ``` apt-get install cifs-utils apt-get install parallel wget httpie sqlite3 git clone -b 1.2-3 https://github.com/lucascbeyeler/zmbackup.git cd zmbackup ./install.sh ``` You will get a certain of questions answer the following ``` Inform Zimbra's defaut user - DEFAULT [zimbra]: Inform Zimbra's defaut install path - DEFAULT [/opt/zimbra]: Inform the path Zmbackup will use to store - DEFAULT [/opt/zimbra/backup]: Inform the account to receive all Zmbackup's alerts - DEFAULT [admin@xxxx: Inform Zmbackup's number of threads - DEFAULT [3]: Inform the number of days Zmbackup should store the backups - DEFAULT [30]: Zmbackup should limit backups for one per day? - DEFAULT [true]:false Where you want to store Zmbackup's sessions? TXT or SQLITE3 - DEFAULT [TXT]: Inform a password for zmbackup user - DEFAULT [OTx]: ```
Author
Owner

@cvdgenugten commented on GitHub (Jun 28, 2021):

Same here..

zimbra@postoffice:~$ zmbackup -i -a admin@coredata.app
/usr/local/lib/zmbackup/bash/BackupAction.sh: line 100: admin@coredata.app//,/\n/g: No such file or directory
Nothing to do. Closing.

<!-- gh-comment-id:869633251 --> @cvdgenugten commented on GitHub (Jun 28, 2021): Same here.. zimbra@postoffice:~$ zmbackup -i -a admin@coredata.app /usr/local/lib/zmbackup/bash/BackupAction.sh: line 100: admin@coredata.app//,/\n/g: No such file or directory Nothing to do. Closing.
Author
Owner

@cvdgenugten commented on GitHub (Jun 28, 2021):

on line 100 the script itirates through $4//,/\n/g in variable $i to add them to file $TEMPACCOUNT.
However, it crashes on the $4//,/\n/g.

GNU bash, version 4.4.20(1)-release (x86_64-pc-linux-gnu)
In my case, admin@coredata.app is used, and bash is trying to RUN on line 100:
$("admin@coredata.app//,/\n/g")

which doesn't make sense..
zimbra@postoffice:~$ $("admin@coredata.app//,/\n/g")
bash: admin@coredata.app//,/\n/g: No such file or directory

<!-- gh-comment-id:869647359 --> @cvdgenugten commented on GitHub (Jun 28, 2021): on line 100 the script itirates through $4//,/\n/g in variable $i to add them to file $TEMPACCOUNT. However, it crashes on the $4//,/\n/g. GNU bash, version 4.4.20(1)-release (x86_64-pc-linux-gnu) In my case, admin@coredata.app is used, and bash is trying to RUN on line 100: $("admin@coredata.app//,/\n/g") which doesn't make sense.. zimbra@postoffice:~$ $("admin@coredata.app//,/\n/g") bash: admin@coredata.app//,/\n/g: No such file or directory
Author
Owner

@cvdgenugten commented on GitHub (Jun 28, 2021):

Are you trying to search and replace comma's for newlines by any chance?
This does not seem to work in bash 4.4.20 in your script.
Can you rewrite?

<!-- gh-comment-id:869650931 --> @cvdgenugten commented on GitHub (Jun 28, 2021): Are you trying to search and replace comma's for newlines by any chance? This does not seem to work in bash 4.4.20 in your script. Can you rewrite?
Author
Owner

@cvdgenugten commented on GitHub (Jun 28, 2021):

assuming you wish to replace comma's for newlines by any chance, the following should work in bash:

100 #    for i in $("$4//,/\n/g"); do
101      for i in $( echo $4 | sed 's/,/ /g' ); do
102       echo $i
103       echo "$i" >> "$TEMPACCOUNT"
104     done
<!-- gh-comment-id:869659777 --> @cvdgenugten commented on GitHub (Jun 28, 2021): assuming you wish to replace comma's for newlines by any chance, the following should work in bash: ``` 100 # for i in $("$4//,/\n/g"); do 101 for i in $( echo $4 | sed 's/,/ /g' ); do 102 echo $i 103 echo "$i" >> "$TEMPACCOUNT" 104 done ```
Author
Owner

@thiagolinhares commented on GitHub (Jan 22, 2022):

for i in $( echo $4 | sed 's/,/ /g' ); do

Tried your approach and worked for me too.
Bash version:
GNU bash, version 4.2.46(2)-release (x86_64-redhat-linux-gnu)

I wonder if you could submit a PR so maintainer could update this?

<!-- gh-comment-id:1019307621 --> @thiagolinhares commented on GitHub (Jan 22, 2022): > for i in $( echo $4 | sed 's/,/ /g' ); do Tried your approach and worked for me too. Bash version: GNU bash, version 4.2.46(2)-release (x86_64-redhat-linux-gnu) I wonder if you could submit a PR so maintainer could update this?
Author
Owner

@thiagowarwick commented on GitHub (Feb 17, 2022):

Same here..
help, please.

zimbra@mail:/usr/local/lib/zmbackup/bash$ zmbackup -f -a thiago.marinho@dominio.com
/usr/local/lib/zmbackup/bash/BackupAction.sh: line 100: thiago.marinho@dominio.com//,/\n/g: No such file or directory
Nothing to do. Closing...

<!-- gh-comment-id:1042994924 --> @thiagowarwick commented on GitHub (Feb 17, 2022): Same here.. help, please. zimbra@mail:/usr/local/lib/zmbackup/bash$ zmbackup -f -a thiago.marinho@dominio.com /usr/local/lib/zmbackup/bash/BackupAction.sh: line 100: thiago.marinho@dominio.com//,/\n/g: No such file or directory Nothing to do. Closing...
Author
Owner

@cvdgenugten commented on GitHub (Feb 17, 2022):

@thiagowarwick I don't think the maintainer is responding to this issue, at least I haven't seen him here.
If you edit /usr/local/lib/zmbackup/bash/BackupAction.sh and change line 100 from:
for i in $("$4//,/\n/g"); do
to:
for i in $( echo $4 | sed 's/,/ /g' ); do
all should work. I've been using this in production for some time now, restoration of single mailboxes works fine, no issues after this change.

<!-- gh-comment-id:1043382907 --> @cvdgenugten commented on GitHub (Feb 17, 2022): @thiagowarwick I don't think the maintainer is responding to this issue, at least I haven't seen him here. If you edit /usr/local/lib/zmbackup/bash/BackupAction.sh and change line 100 from: `for i in $("$4//,/\n/g"); do` to: `for i in $( echo $4 | sed 's/,/ /g' ); do` all should work. I've been using this in production for some time now, restoration of single mailboxes works fine, no issues after this change.
Author
Owner

@thiagowarwick commented on GitHub (Feb 17, 2022):

@thiagowarwick Não acho que o mantenedor esteja respondendo a esse problema, pelo menos não o vi aqui. Se você editar /usr/local/lib/zmbackup/bash/BackupAction.sh e alterar a linha 100 de: for i in $("$4//,/\n/g"); do para: for i in $( echo $4 | sed 's/,/ /g' ); do tudo deve funcionar. Estou usando isso em produção há algum tempo, a restauração de caixas de correio únicas funciona bem, sem problemas após essa alteração.

Thank's my friend.
this worked for me! Congratulations!!!

<!-- gh-comment-id:1043483148 --> @thiagowarwick commented on GitHub (Feb 17, 2022): > @thiagowarwick Não acho que o mantenedor esteja respondendo a esse problema, pelo menos não o vi aqui. Se você editar /usr/local/lib/zmbackup/bash/BackupAction.sh e alterar a linha 100 de: `for i in $("$4//,/\n/g"); do` para: `for i in $( echo $4 | sed 's/,/ /g' ); do` tudo deve funcionar. Estou usando isso em produção há algum tempo, a restauração de caixas de correio únicas funciona bem, sem problemas após essa alteração. Thank's my friend. this worked for me! Congratulations!!!
Author
Owner

@cvdgenugten commented on GitHub (Feb 17, 2022):

haha, I didn't know I wrote that in Portuguese ;)

Prazer & boa sorte,
Tchau!

<!-- gh-comment-id:1043501423 --> @cvdgenugten commented on GitHub (Feb 17, 2022): haha, I didn't know I wrote that in Portuguese ;) Prazer & boa sorte, Tchau!
Author
Owner

@tofuSCHNITZEL commented on GitHub (Aug 30, 2022):

this is fixed here:
github.com/tofuSCHNITZEL/zmbackup@d5028344fe

<!-- gh-comment-id:1232162207 --> @tofuSCHNITZEL commented on GitHub (Aug 30, 2022): this is fixed here: https://github.com/tofuSCHNITZEL/zmbackup/commit/d5028344feb83342d73e5977dfc138c404a913cc
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/zmbackup#127
No description provided.