31
31
#
32
32
#
33
33
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
+
34
73
35
74
exibe_help ()
36
75
{
@@ -382,57 +421,57 @@ rm $WORKDIR/.sessions.txt -f
382
421
exit 0
383
422
}
384
423
385
-
386
- # Carregar e criticar o arquivo de configuração
424
+ # ##### MAIN ############
425
+ # Here the code loads the config file
387
426
source /etc/zmbkpose/zmbkpose.conf
388
427
389
428
if ! [ -z " $BACKUPUSER " ]; then
390
429
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"
392
431
exit 0
393
432
fi
394
433
else
395
- echo " Você precisa definir a variável BACKUPUSER"
434
+ echo " You need to define the variable BACKUPUSER"
396
435
exit 0
397
436
fi
398
437
399
438
if ! [ -z " $WORKDIR " ]; then
400
439
if ! [ -d " $WORKDIR " ]; then
401
- echo " O diretório $WORKDIR não existe "
440
+ echo " The directory $WORKDIR doesn't exist "
402
441
exit 0
403
442
fi
404
443
else
405
- echo " Você precisa definir a variável WORKDIR"
444
+ echo " You need to define the variable WORKDIR"
406
445
exit 0
407
446
fi
408
447
409
448
if [ -z " $ADMINUSER " ]; then
410
- echo " Você precisa definir a variável ADMINUSER"
449
+ echo " You need to define the variable ADMINUSER"
411
450
exit 0
412
451
fi
413
452
414
453
if [ -z " $ADMINPASS " ]; then
415
- echo " Você precisa definir a variável ADMINPASS"
454
+ echo " You need to define the variable ADMINPASS"
416
455
exit 0
417
456
fi
418
457
419
458
if [ -z " $LDAPMASTERSERVER " ]; then
420
- echo " Você precisa definir a variável LDAPMASTERSERVER"
459
+ echo " You need to define the variable LDAPMASTERSERVER"
421
460
exit 0
422
461
fi
423
462
424
463
if [ -z " $LDAPZIMBRADN " ]; then
425
- echo " Você precisa definir a variável LDAPZIMBRADN"
464
+ echo " You need to define the variable LDAPZIMBRADN"
426
465
exit 0
427
466
fi
428
467
429
468
if [ -z " $LDAPZIMBRAPASS " ]; then
430
- echo " Você precisa definir a variável LDAPZIMBRAPASS"
469
+ echo " You need to define the variable LDAPZIMBRAPASS"
431
470
exit 0
432
471
fi
433
472
434
473
if [ -z " $LOGFILE " ]; then
435
- echo " Você precisa definir a variável LOGFILE"
474
+ echo " You need to define the variable LOGFILE"
436
475
exit 0
437
476
fi
438
477
441
480
case " $1 " in
442
481
" -f" )
443
482
if [ $PARALLEL_SUPPORT -eq 1 ]; then
444
- echo " Executando backup Paralelo "
483
+ echo " Running the parallel backup "
445
484
backup_todas_contas_parallel
446
485
else
447
486
if [ -z " $2 " ]; then
@@ -450,8 +489,8 @@ case "$1" in
450
489
if [ -z " $3 " ]; then
451
490
backup_contas $2
452
491
fi
453
- echo " Parâmetros $@ incorretos. Reveja o help."
454
- exibe_help
492
+ echo " Incorrect $@ params. Read -- help."
493
+ show_help
455
494
fi
456
495
fi
457
496
;;
@@ -462,61 +501,61 @@ case "$1" in
462
501
if [ -z " $3 " ]; then
463
502
incremental_contas $2
464
503
fi
465
- echo " Parâmetros $@ incorretos. Reveja o help."
466
- exibe_help
504
+ echo " Incorrect $@ params. Read the -- help."
505
+ show_help
467
506
fi
468
507
;;
469
508
" -l" )
470
509
if [ -z " $2 " ]; then
471
510
lista_sessoes
472
511
else
473
- echo " Parâmetros $@ incorretos. Reveja o help."
474
- exibe_help
512
+ echo " Incorrect $@ params. Read the -- help."
513
+ show_help
475
514
fi
476
515
;;
477
516
" -r" )
478
517
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
481
520
else
482
521
if [ -z " $4 " ]; then
483
522
restaura_contas $2 $3
484
523
else
485
- echo " Parâmetros $@ incorretos. Reveja o help."
486
- exibe_help
524
+ echo " Incorrect $@ params. Read the -- help."
525
+ show_help
487
526
fi
488
527
fi
489
528
;;
490
529
" -restoreAccount" )
491
530
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
494
533
else
495
534
if [ -z " $3 " ]; then
496
535
restaura_LDAP_conteudo $2
497
536
else
498
537
if [ " $3 " = " --LDAPOnly" ]; then
499
538
restaura_LDAP_conteudo $2 $4
500
539
else
501
- echo " Parâmetros $@ incorretos. Reveja o help."
502
- exibe_help
540
+ echo " Incorrect $@ params. Read the -- help."
541
+ show_help
503
542
fi
504
543
fi
505
544
fi
506
545
507
546
;;
508
547
" --DeusMeAjude" )
509
548
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
512
551
else
513
552
DeusMeAjude
514
553
fi
515
554
;;
516
555
" -d" )
517
556
if [ -z " $2 " ]; then
518
557
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
520
559
exit 0
521
560
fi
522
561
if [ $2 -eq $2 2> /dev/null ]; then
@@ -532,22 +571,22 @@ case "$1" in
532
571
;;
533
572
* )
534
573
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
536
575
exit 0
537
576
;;
538
577
esac
539
578
fi
540
579
rotate_backup $OLDEST
541
580
else
542
581
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
544
583
exit 0
545
584
fi
546
585
;;
547
586
548
587
* )
549
588
echo " Parâmetros $@ incorretos. Reveja o help."
550
- exibe_help
589
+ show_help
551
590
;;
552
591
esac
553
592
exit 0
0 commit comments