Open maximishchenko opened 3 years ago
run this to backup only one email
zmbackup -f -a email@domain.com
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...
can you show me output of
cat /etc/zmbackup/zmbackup.conf
[root@mail ~]# cat /etc/zmbackup/zmbackup.conf ###############################################################################
###############################################################################
###############################################################################
BACKUPUSER=zimbra
WORKDIR=/opt/zimbra/backup
LDAPSERVER=ldap://10.10.10.10:389
LDAPADMIN=uid=zimbra,cn=admins,cn=zimbra
LDAPPASS=pwd
LOGFILE=/opt/zimbra/log/zmbackup.log
ENABLE_EMAIL_NOTIFY=all
EMAIL_NOTIFY=my@example.com
EMAIL_SENDER=
MAX_PARALLEL_PROCESS=3
ROTATE_TIME=30
LOCK_BACKUP=true
SESSION_TYPE=SQLITE3
BACKUP_INACTIVE_ACCOUNTS=true
SSL_ENABLE=true
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]:
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.
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
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?
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
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?
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...
@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.
@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!!!
haha, I didn't know I wrote that in Portuguese ;)
Prazer & boa sorte, Tchau!
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?