Skip to content

Commit eb9697a

Browse files
committed
Translate some output and the help section
1 parent 43d4a6a commit eb9697a

File tree

1 file changed

+72
-33
lines changed

1 file changed

+72
-33
lines changed

src/zmbkpose

100644100755
+72-33
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,45 @@
3131
#
3232
#
3333

34+
show_help ()
35+
{
36+
echo "Usage:
37+
zmbkpose -f
38+
Execute full backup, all accounts.
39+
zmbkpose -f mail1,mail2,...,mailn
40+
Execute backup full for specific accounts.
41+
zmbkpose -i
42+
Execute a full incremental backup all accounts.
43+
Needs a least one full backup of all account complete.
44+
zmbkpose -i mail1,mail2,...,mailn
45+
Execute a incremental backup in specified accounts provided in the command line.
46+
If the account doesn't have a previosly full backup, will be done in the same session.
47+
zmbkpose -l
48+
List backup sessions already done.
49+
zmbkpose -r mail1,mail2,...,mailn nome_da_sessao
50+
Restore content from accounts specified by command line.
51+
If yout dont provide the name session will be run a full restore: All Backup found, from the oldest to the newer.
52+
zmbkpose -restoreAccount mail1,mail2,...,mailn
53+
Restore accounts removed from the older backup to the newer.
54+
zmbkpose -restoreAccount mail1,mail2,...,mailn --LDAPOnly nome_da_sessao
55+
Restore only the user profile, including password.
56+
TIP: Could be necesery update the server cache to apply restored attributes.
57+
zmprov fc account nome_da_conta
58+
zmbkpose -d n
59+
Where \"n\" is a number.
60+
Exclude all backup before <number> days.
61+
zmbkpose -d n weeks
62+
Where \"n\" is a number.
63+
Exclude all backup before <number> weeks.
64+
zmbkpose -d n months
65+
Onde \"n\" é um número.
66+
Exclude all backup before <number> of months.
67+
68+
"
69+
# Deixar uma opção de "Disaster Recovery" oculta + confirmações
70+
exit 0
71+
}
72+
3473

3574
exibe_help ()
3675
{
@@ -382,57 +421,57 @@ rm $WORKDIR/.sessions.txt -f
382421
exit 0
383422
}
384423

385-
386-
# Carregar e criticar o arquivo de configuração
424+
###### MAIN ############
425+
# Here the code loads the config file
387426
source /etc/zmbkpose/zmbkpose.conf
388427

389428
if ! [ -z "$BACKUPUSER" ]; then
390429
if [ "$(id -u)" != "$(id -u $BACKUPUSER)" ]; then
391-
echo "É preciso ser $BACKUPUSER para executar este script"
430+
echo "You need to be $BACKUPUSER to run this script"
392431
exit 0
393432
fi
394433
else
395-
echo "Você precisa definir a variável BACKUPUSER"
434+
echo "You need to define the variable BACKUPUSER"
396435
exit 0
397436
fi
398437

399438
if ! [ -z "$WORKDIR" ]; then
400439
if ! [ -d "$WORKDIR" ]; then
401-
echo "O diretório $WORKDIR não existe"
440+
echo "The directory $WORKDIR doesn't exist"
402441
exit 0
403442
fi
404443
else
405-
echo "Você precisa definir a variável WORKDIR"
444+
echo "You need to define the variable WORKDIR"
406445
exit 0
407446
fi
408447

409448
if [ -z "$ADMINUSER" ]; then
410-
echo "Você precisa definir a variável ADMINUSER"
449+
echo "You need to define the variable ADMINUSER"
411450
exit 0
412451
fi
413452

414453
if [ -z "$ADMINPASS" ]; then
415-
echo "Você precisa definir a variável ADMINPASS"
454+
echo "You need to define the variable ADMINPASS"
416455
exit 0
417456
fi
418457

419458
if [ -z "$LDAPMASTERSERVER" ]; then
420-
echo "Você precisa definir a variável LDAPMASTERSERVER"
459+
echo "You need to define the variable LDAPMASTERSERVER"
421460
exit 0
422461
fi
423462

424463
if [ -z "$LDAPZIMBRADN" ]; then
425-
echo "Você precisa definir a variável LDAPZIMBRADN"
464+
echo "You need to define the variable LDAPZIMBRADN"
426465
exit 0
427466
fi
428467

429468
if [ -z "$LDAPZIMBRAPASS" ]; then
430-
echo "Você precisa definir a variável LDAPZIMBRAPASS"
469+
echo "You need to define the variable LDAPZIMBRAPASS"
431470
exit 0
432471
fi
433472

434473
if [ -z "$LOGFILE" ]; then
435-
echo "Você precisa definir a variável LOGFILE"
474+
echo "You need to define the variable LOGFILE"
436475
exit 0
437476
fi
438477

@@ -441,7 +480,7 @@ fi
441480
case "$1" in
442481
"-f" )
443482
if [ $PARALLEL_SUPPORT -eq 1 ];then
444-
echo "Executando backup Paralelo"
483+
echo "Running the parallel backup"
445484
backup_todas_contas_parallel
446485
else
447486
if [ -z "$2" ]; then
@@ -450,8 +489,8 @@ case "$1" in
450489
if [ -z "$3" ]; then
451490
backup_contas $2
452491
fi
453-
echo "Parâmetros $@ incorretos. Reveja o help."
454-
exibe_help
492+
echo "Incorrect $@ params. Read --help."
493+
show_help
455494
fi
456495
fi
457496
;;
@@ -462,61 +501,61 @@ case "$1" in
462501
if [ -z "$3" ]; then
463502
incremental_contas $2
464503
fi
465-
echo "Parâmetros $@ incorretos. Reveja o help."
466-
exibe_help
504+
echo "Incorrect $@ params. Read the --help."
505+
show_help
467506
fi
468507
;;
469508
"-l" )
470509
if [ -z "$2" ]; then
471510
lista_sessoes
472511
else
473-
echo "Parâmetros $@ incorretos. Reveja o help."
474-
exibe_help
512+
echo "Incorrect $@ params. Read the --help."
513+
show_help
475514
fi
476515
;;
477516
"-r" )
478517
if [ -z "$2" ]; then
479-
echo "Parâmetros $@ incorretos. Reveja o help."
480-
exibe_help
518+
echo "Incorrect $@ params. Read the --help."
519+
show_help
481520
else
482521
if [ -z "$4" ]; then
483522
restaura_contas $2 $3
484523
else
485-
echo "Parâmetros $@ incorretos. Reveja o help."
486-
exibe_help
524+
echo "Incorrect $@ params. Read the --help."
525+
show_help
487526
fi
488527
fi
489528
;;
490529
"-restoreAccount" )
491530
if [ -z "$2" ]; then
492-
echo "Parâmetros $@ incorretos. Reveja o help."
493-
exibe_help
531+
echo "Incorrect $@ params. Read the --help."
532+
show_help
494533
else
495534
if [ -z "$3" ]; then
496535
restaura_LDAP_conteudo $2
497536
else
498537
if [ "$3" = "--LDAPOnly" ]; then
499538
restaura_LDAP_conteudo $2 $4
500539
else
501-
echo "Parâmetros $@ incorretos. Reveja o help."
502-
exibe_help
540+
echo "Incorrect $@ params. Read the --help."
541+
show_help
503542
fi
504543
fi
505544
fi
506545

507546
;;
508547
"--DeusMeAjude" )
509548
if ! [ -z "$2" ]; then
510-
echo "Parâmetros $@ incorretos. Reveja o help."
511-
exibe_help
549+
echo "Incorrect $@ params. Read the --help."
550+
show_help
512551
else
513552
DeusMeAjude
514553
fi
515554
;;
516555
"-d" )
517556
if [ -z "$2" ]; then
518557
echo "O parametro -d aceita apenas um número de dias, ou um número seguido dos complementos weeks para semanas ou months para meses"
519-
exibe_help
558+
show_help
520559
exit 0
521560
fi
522561
if [ $2 -eq $2 2> /dev/null ]; then
@@ -532,22 +571,22 @@ case "$1" in
532571
;;
533572
* )
534573
echo "O parametro -d aceita apenas um número de dias, ou um número seguido dos complementos weeks para semanas ou months para meses"
535-
exibe_help
574+
show_help
536575
exit 0
537576
;;
538577
esac
539578
fi
540579
rotate_backup $OLDEST
541580
else
542581
echo "O parametro -d aceita apenas um número de dias, ou um número seguido dos complementos weeks para semanas ou months para meses"
543-
exibe_help
582+
show_help
544583
exit 0
545584
fi
546585
;;
547586

548587
* )
549588
echo "Parâmetros $@ incorretos. Reveja o help."
550-
exibe_help
589+
show_help
551590
;;
552591
esac
553592
exit 0

0 commit comments

Comments
 (0)