/[smecontribs]/rpms/smeserver-zabbix-agent/contribs10/smeserver-zabbix-agent-0.4.8-bz12032-backup.patch
ViewVC logotype

Contents of /rpms/smeserver-zabbix-agent/contribs10/smeserver-zabbix-agent-0.4.8-bz12032-backup.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download)
Mon Aug 1 18:39:56 2022 UTC (2 years, 3 months ago) by jpp
Branch: MAIN
CVS Tags: smeserver-zabbix-agent-0_4_8-3_el7_sme, HEAD
* Mon Aug 01 2022 Jean-Philippe Pialasse <tests@pialasse.com> 0.4.8-3.sme
- add to core backup [SME: 12032]

1 diff -Nur --no-dereference smeserver-zabbix-agent-0.4.8.old/createlinks smeserver-zabbix-agent-0.4.8/createlinks
2 --- smeserver-zabbix-agent-0.4.8.old/createlinks 2022-08-01 14:31:56.522000000 -0400
3 +++ smeserver-zabbix-agent-0.4.8/createlinks 2022-08-01 14:37:04.343000000 -0400
4 @@ -22,6 +22,7 @@
5 templates2events("/etc/sudoers", $event);
6 templates2events("/etc/rc.d/init.d/masq", $event);
7 templates2events("/etc/crontab", $event);
8 +templates2events("/etc/backup-data.d/smeserver-zabbix-agent.include", $event);
9
10 # Services to restart
11 safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/zabbix-agent");
12 diff -Nur --no-dereference smeserver-zabbix-agent-0.4.8.old/root/etc/e-smith/templates/etc/backup-data.d/smeserver-zabbix-agent.include/template-begin smeserver-zabbix-agent-0.4.8/root/etc/e-smith/templates/etc/backup-data.d/smeserver-zabbix-agent.include/template-begin
13 --- smeserver-zabbix-agent-0.4.8.old/root/etc/e-smith/templates/etc/backup-data.d/smeserver-zabbix-agent.include/template-begin 1969-12-31 19:00:00.000000000 -0500
14 +++ smeserver-zabbix-agent-0.4.8/root/etc/e-smith/templates/etc/backup-data.d/smeserver-zabbix-agent.include/template-begin 2022-08-01 14:32:41.771000000 -0400
15 @@ -0,0 +1,21 @@
16 +#Only non rpm owned files are backupe there
17 +{
18 +use RPM2;
19 +my $rpm_db = RPM2->open_rpm_db();
20 +
21 +my @dirs = qw(
22 +/etc/zabbix
23 +/etc/zabbix/zabbix_agentd.conf.d/
24 +/var/lib/zabbix/bin/
25 +);
26 +
27 +foreach my $some_dir (@dirs) {
28 + next unless ( -e $some_dir );
29 + opendir(my $dh, $some_dir) || die "Can't open $some_dir: $!";
30 + while ( (my $file = readdir $dh) ) {
31 + next if $file =~ /^\.{1,2}$/;
32 + $OUT .= "$some_dir/$file\n" unless $rpm_db->find_by_file("$some_dir/$file");
33 + }
34 + closedir $dh;
35 +}
36 +}

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed