/[smecontribs]/rpms/smeserver-freepbx/contribs10/smeserver-freepbx-14-bz10703-backup.patch
ViewVC logotype

Contents of /rpms/smeserver-freepbx/contribs10/smeserver-freepbx-14-bz10703-backup.patch

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


Revision 1.1 - (show annotations) (download)
Wed Dec 7 17:15:58 2022 UTC (22 months, 4 weeks ago) by jpp
Branch: MAIN
CVS Tags: smeserver-freepbx-14-9_el7_sme, smeserver-freepbx-14-11_el7_sme, smeserver-freepbx-14-13_el7_sme, smeserver-freepbx-14-10_el7_sme, smeserver-freepbx-14-12_el7_sme, smeserver-freepbx-14-14_el7_sme, HEAD
Error occurred while calculating annotation data.
* Wed Dec 07 2022 Jean-Philippe Pialasse <tests@pialasse.com> 14-9.sme
- improve backup  [SME: 10703]

1 diff -Nur --no-dereference smeserver-freepbx-14.old/root/etc/e-smith/events/actions/freepbx-backup smeserver-freepbx-14/root/etc/e-smith/events/actions/freepbx-backup
2 --- smeserver-freepbx-14.old/root/etc/e-smith/events/actions/freepbx-backup 2022-03-27 23:45:44.000000000 -0400
3 +++ smeserver-freepbx-14/root/etc/e-smith/events/actions/freepbx-backup 2022-12-07 12:14:47.321000000 -0500
4 @@ -1,3 +1,3 @@
5 #!/bin/bash
6
7 -su asterisk -s /bin/bash -c 'php /var/lib/asterisk/bin/backup.php --id=1'
8 +su asterisk -s /bin/bash -c '/usr/sbin/php /var/lib/asterisk/bin/backup.php --id=1'
9 diff -Nur --no-dereference smeserver-freepbx-14.old/root/etc/e-smith/events/actions/freepbx-checkinstall-backup smeserver-freepbx-14/root/etc/e-smith/events/actions/freepbx-checkinstall-backup
10 --- smeserver-freepbx-14.old/root/etc/e-smith/events/actions/freepbx-checkinstall-backup 2022-03-27 23:45:44.000000000 -0400
11 +++ smeserver-freepbx-14/root/etc/e-smith/events/actions/freepbx-checkinstall-backup 2022-12-07 12:04:43.592000000 -0500
12 @@ -3,25 +3,16 @@
13 DBNAME=$(/sbin/e-smith/db configuration getprop freepbx DbName)
14 backuppath='/home/e-smith/files/freepbx'
15
16 -# check if backup module is enabled and running
17 +# check if backup module is local, enabled and running
18 # if not solve this...
19 -if [[ ! `/usr/sbin/fwconsole ma list|/bin/grep backup|/bin/grep Enabled` ]] ; then
20 -
21 - if [[ ! `/usr/sbin/fwconsole ma list|/bin/grep backup` ]] ;then
22 - /usr/sbin/fwconsole ma download backup -R standard -R extended 2>&1 >/dev/null
23 - /usr/sbin/fwconsole ma install backup -R standard -R extended 2>&1 >/dev/null
24 - fi
25 -
26 - if [[ `/usr/sbin/fwconsole ma list|/bin/grep backup| grep 'Not Installed'` ]] ;then
27 - /usr/sbin/fwconsole ma install backup -R standard -R extended 2>&1 >/dev/null
28 - fi
29 -
30 - if [[ `/usr/sbin/fwconsole ma list|/bin/grep backup|/bin/grep Disabled` ]] ; then
31 - /usr/sbin/fwconsole ma enable backup 2>&1 >/dev/null
32 - fi
33 -
34 - /usr/sbin/fwconsole r
35 +if [[ ! `/usr/sbin/fwconsole ma list|/bin/grep backup` ]] ;then
36 + /usr/sbin/fwconsole ma download backup -R standard -R extended >/dev/null 2>&1
37 fi
38 +#force install
39 +/usr/sbin/fwconsole ma install backup -R standard -R extended >/dev/null 2>&1
40 +# force enable
41 +/usr/sbin/fwconsole ma enable backup >/dev/null 2>&1
42 +/usr/sbin/fwconsole r >/dev/null
43
44 # check our freepbx backup folder is there and accessible
45 if [[ ! -d $backuppath ]] ; then
46 @@ -33,7 +24,7 @@
47 mysql -e "use $DBNAME;UPDATE backup_server_details set value = '/home/e-smith/files/freepbx' WHERE server_id = 1;"
48 # set info for backup 1
49 #data = a:1:{s:10:"created_by";s:11:"install.php";}
50 -mysql -e "use $DBNAME;INSERT INTO backup (\`id\`, \`name\`, \`description\` , \`immortal\` ,\`data\`, \`email\` ) VALUES (1, 'Default backup', 'Default SME PBX backup; automatically installed', 'true','', 'admin' ) ON DUPLICATE KEY UPDATE \`description\` = 'Default SME PBX backup; automatically installed', \`immortal\` = 'true', \`email\` = 'admin' , \`name\`= 'Default backup' ;"
51 +mysql -e "use $DBNAME;INSERT INTO backup (\`id\`, \`name\`, \`description\` , \`immortal\` ,\`data\`, \`email\` ) VALUES (1, 'Default backup', 'Default SME PBX backup; automatically installed', 'true','', 'admin' ) ON DUPLICATE KEY UPDATE \`description\` = 'Default SME PBX backup; automatically installed', \`immortal\` = 'true', \`email\` = 'admin' , \`name\`= 'Default backup' ;" 2>/dev/null || mysql -e "use $DBNAME;INSERT INTO backup (\`id\`, \`name\`, \`emailaddr\` ) VALUES (1, 'SMEbackup', 'admin' ) ON DUPLICATE KEY UPDATE \`name\` = 'SMEbackup', \`emailaddr\` = 'admin' ;"
52
53 mysql -e "use $DBNAME;ALTER TABLE backup_details ADD UNIQUE uniq ( \`backup_id\` , \`key\` , \`index\` ) ;"
54 mysql -e "use $DBNAME;INSERT INTO backup_details (\`backup_id\`, \`key\`, \`index\`, \`value\`) VALUES
55 @@ -68,5 +59,5 @@
56 mysql -e "use $DBNAME;ALTER TABLE backup_items DROP INDEX \`uniq\` ;"
57
58 # make sure all perms are ok for backup
59 -/usr/sbin/fwconsole chown 2>&1 >/dev/null
60 +/usr/sbin/fwconsole chown > /dev/null 2>&1
61

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