|
14 | 14 | ## |
15 | 15 | # |
16 | 16 | # Script installation: |
17 | | -# |
18 | 17 | # echo "cd /etc/bacula/scripts && git clone https://github.com/MykolaPerehinets/auditlinuxsystem.git" |
19 | 18 | # |
20 | | -# Script function: Audit Linux systems/services for correct backup process |
| 19 | +# Script function: |
| 20 | +# Audit and Inventory All Configurations files/Services on Linux servers/hosts (for Bacula Bare-Metal Recovery) |
21 | 21 | # |
22 | | -# Script requirements: |
23 | | -# yum install bacula-client vim parted pciutils yum-plugin-security yum-plugin-verify yum-plugin-changelog lsusb lshw usbutils lsscsi pigz mlocate time glances tuned redhat-lsb-core etckeeper firewalld mailx policycoreutils-python policycoreutils-newrole policycoreutils-restorecond setools-console lsof iotop htop tree mutt psacct |
| 22 | +# Script requirements 1: |
| 23 | +# yum update && yum install bacula-client vim parted pciutils yum-plugin-security yum-plugin-verify yum-plugin-changelog lsusb lshw usbutils lsscsi pigz mlocate time glances tuned redhat-lsb-core etckeeper firewalld mailx policycoreutils-python policycoreutils-newrole policycoreutils-restorecond setools-console lsof iotop htop tree mutt psacct |
24 | 24 | # |
25 | | -# Addditional requirements: for initial etckeeper run next command from root |
| 25 | +# Script requirements 2: for initial setup the etckeeper, please run next command from root user |
26 | 26 | # cd /etc |
27 | 27 | # sudo etckeeper init |
28 | 28 | # sudo etckeeper commit "Initial import" |
29 | 29 | # git config --global user.name "root" |
30 | | -# git config --global user.email root@"HOSTNAME"."DOMAIN" |
| 30 | +# git config --global user.email root@localhost.localdomain |
31 | 31 | # |
32 | | -# Addditional requirements: for initial bacula scripts run next command from root |
| 32 | +# Addditional requirements: for initial setup the bacula scripts, please run next command from root user |
33 | 33 | # cd /etc/bacula/scripts |
34 | 34 | # setenforce 0 |
35 | 35 | # tail -fn 0 /var/log/audit/audit.log | grep bacula > /etc/bacula/bacula-audit.log |
36 | | -# * (run a backup job that has a pre-script) |
| 36 | +# * (run a simple backup job that has a pre-script) |
37 | 37 | # chcon system_u:object_r:bacula_exec_t:s0 /etc/bacula/scripts |
38 | 38 | # semanage fcontext -a -t bacula_exec_t "/etc/bacula/scripts(/.*)?" |
39 | 39 | # restorecon -R -v /etc/bacula/scripts |
|
66 | 66 | # DONE |
67 | 67 | # setenforce 1 |
68 | 68 | # |
69 | | -# Script Submitted and Deployment in production environments by: |
| 69 | +# |
| 70 | +# Script Submitted and Deployment in Production environments by: |
70 | 71 | # Mykola Perehinets (mperehin) |
71 | 72 | # Tel: +380 67 772 6910 |
72 | 73 | |
73 | 74 | # |
74 | 75 | ####################################################################################################################### |
75 | 76 | # Script modified date |
76 | | -Version=04072017 |
| 77 | +Version=06012022 |
77 | 78 | # |
78 | 79 | ####################################################################################################################### |
79 | 80 | # Exit code |
80 | 81 | ERR=0 |
81 | 82 | # Basic script configuration, etc... |
82 | 83 | PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin |
83 | 84 | # |
84 | | -#ADMIN="root@"HOSTNAME"."DOMAIN"" |
| 85 | +#ADMIN="root@localhost.localdomain" |
85 | 86 | |
86 | 87 | # |
87 | 88 | #HOSTNAME=`hostname -s` |
@@ -381,12 +382,12 @@ echo "########################################################################## |
381 | 382 | # |
382 | 383 | # Create and verify other parameters |
383 | 384 | /bin/chmod 0644 $auditlogdir/server_inventory_$HOSTNAME.log |
384 | | -echo "Create backup inventory data and store in $auditlogdir/server_inventory_$HOSTNAME.log" |
385 | | -echo "This data file is needed for Disaster Recovery Plan using in Corporate Backup System Bacula!" |
| 385 | +echo "Create new backup inventory data and store in $auditlogdir/server_inventory_$HOSTNAME.log" |
| 386 | +echo "This audit/data file is needed for Disaster Recovery Plan using in Corporate Backup System Bacula!" |
386 | 387 | #echo "OK... Audit your system has been DONE... Thank you..." |
387 | 388 | # |
388 | | -# Sending copy of data to admins MailGroup |
389 | | -msg="This is copy of inventory data on HOST: $HOSTNAME, verify at $DATE_START. This file is needed for recovery procedures... -->" |
| 389 | +# Sending copy of data to DevOps MailGroup |
| 390 | +msg="This is copy of inventory data from HOST: $HOSTNAME, verify at $DATE_START. This audit/data file is needed for bare metal recovery procedures... -->" |
390 | 391 | #echo $msg |
391 | 392 | #sed -e 's/$/\r/' $auditlogdir/server_inventory_$HOSTNAME.log | pigz --best --independent > $auditlogdir/server_inventory_$HOSTNAME.log.win.txt.gz |
392 | 393 | sed -e 's/$/\r/' $auditlogdir/server_inventory_$HOSTNAME.log > $auditlogdir/server_inventory_$HOSTNAME.log.win.txt |
|
399 | 400 | #echo "$msg" | mail -s "WARNING: inventory of HOST: $HOSTNAME -->" -a $auditlogdir/server_inventory_$HOSTNAME.log.win.txt $ADMIN |
400 | 401 | #echo -n $msg $msg_body | mail -s "WARNING: inventory of HOST: $HOSTNAME -->" $ADMIN |
401 | 402 | echo -n $msg | mutt -s "WARNING: inventory of HOST: $HOSTNAME -->" -a $auditlogdir/server_inventory_$HOSTNAME.log.win.txt $ADMIN |
402 | | -echo "Sending copy this data file to admins - MailGroup: $ADMIN " |
| 403 | +echo "Sending copy of this audit/data file to DevOps - MailGroup: $ADMIN " |
403 | 404 | echo "OK... Very well... Please Start-up next Corporate Bacula Backup System procedures..." |
404 | 405 | # |
405 | 406 | # Exit code script status |
|
0 commit comments