{"id":2415,"date":"2020-03-03T23:22:16","date_gmt":"2020-03-03T23:22:16","guid":{"rendered":"https:\/\/www.cyber-cottage.eu\/?p=2415"},"modified":"2020-03-03T23:22:16","modified_gmt":"2020-03-03T23:22:16","slug":"backing-up-files-in-freepbx-15","status":"publish","type":"post","link":"https:\/\/www.cyber-cottage.co.uk\/?p=2415","title":{"rendered":"Backing up files in FreePBX 15"},"content":{"rendered":"\n<p>The first time you come to restore your FREEpbx 15 system you may find that not everything that you expected is there !<\/p>\n\n\n\n<p>The new backup module backs up on a module by module base and not like before where is was DBs and Files.<\/p>\n\n\n\n<p>Linked here is a repository that has the files to create a module that can be edited to backup directories. <\/p>\n\n\n\n<p><a href=\"https:\/\/bitbucket.org\/cybercottage\/filebackup\">https:\/\/bitbucket.org\/cybercottage\/filebackup<\/a><\/p>\n\n\n\n<p>The file you need to edit is Backup.php <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>&lt;?php<\/strong>\n\n<strong>namespace<\/strong> FreePBX\\modules\\Filebackup;\n<strong>use<\/strong> FreePBX\\modules\\Backup <strong>as<\/strong> Base;\n\n<strong>class<\/strong> Backup <strong>extends<\/strong> Base\\BackupBase\n{\n    <strong>public<\/strong> <strong>function<\/strong> runBackup($id, $transaction)\n    {\n        $this->addDirectories([\n            '<em><strong>\/etc\/asterisk<\/strong><\/em>','<strong><em>\/tftpboot<\/em><\/strong>',\n        ]);\n        $files = glob(\"<em><strong>\/etc\/asterisk\/*conf<\/strong><\/em>\");\n        <strong>foreach<\/strong> ($files <strong>as<\/strong> $file) {\n            $path = pathinfo($file, PATHINFO_DIRNAME);\n            $this->addFile(basename($file), $path, '', \"conf\");\n\u00a0\u00a0\u00a0\u00a0}\n\u00a0\u00a0\u00a0\u00a0$files = glob(\"<strong><em>\/tftpboot\/*xml<\/em><\/strong>\");\n        <strong>foreach<\/strong> ($files <strong>as<\/strong> $file) {\n            $path = pathinfo($file, PATHINFO_DIRNAME);\n            $this->addFile(basename($file), $path, '', \"conf\");\n        }\n        <strong>return<\/strong> $this;\n    }\n}\n<\/pre>\n\n\n\n<p>As you see we are backing up <em><strong>\/etc\/asterisk<\/strong><\/em> and <strong><em>\/tftpboot<\/em><\/strong> , But only <span style=\"text-decoration: underline;\">*.conf<\/span> files in \/etc\/asterisk and only <span style=\"text-decoration: underline;\">*.xml<\/span> files in \/tftpboot <\/p>\n\n\n\n<p>Details on the new backup system are here <a href=\"https:\/\/wiki.freepbx.org\/display\/FOP\/Implementing+Backup\">https:\/\/wiki.freepbx.org\/display\/FOP\/Implementing+Backup<\/a> <\/p>\n\n\n\n<p>Thanks to James Finstrom for the original version of this, This version is not to replace his work but only to give an example of working with Multiple directories<\/p>\n\n\n\n<p>The downloaded zip file needs to be added as a Local module via Module Admin and enabled, It will obviously give a signing error but this can be disabled in Advanced settings or ignored ;-)<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>Enjoy but don&#8217;t blame me if it doesn&#8217;t work. Ive tested it on my systems and all seems good by your experience may be different<\/p>\n\n\n\n<p> <\/p>\n","protected":false},"excerpt":{"rendered":"<p>The first time you come to restore your FREEpbx 15 system you may find that not everything that you expected is there ! The new backup module backs up on a module by module base and not like before where is was DBs and Files. Linked here is a repository that has the files to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":626,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"content-type":"","advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[88,104,11,6,7],"tags":[23,40,51,117],"class_list":["post-2415","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-astsupport","category-freepbx","category-knowledge","category-support-services","category-technical","tag-asterisk","tag-freepbx","tag-linux","tag-sangoma"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.cyber-cottage.co.uk\/wp-content\/uploads\/2013\/02\/JIGSAW3.png?fit=205%2C223&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/p5daZy-CX","jetpack_sharing_enabled":true,"jetpack_likes_enabled":false,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/www.cyber-cottage.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/2415","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.cyber-cottage.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.cyber-cottage.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.cyber-cottage.co.uk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cyber-cottage.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2415"}],"version-history":[{"count":2,"href":"https:\/\/www.cyber-cottage.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/2415\/revisions"}],"predecessor-version":[{"id":2417,"href":"https:\/\/www.cyber-cottage.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/2415\/revisions\/2417"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.cyber-cottage.co.uk\/index.php?rest_route=\/wp\/v2\/media\/626"}],"wp:attachment":[{"href":"https:\/\/www.cyber-cottage.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2415"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cyber-cottage.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2415"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cyber-cottage.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2415"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}