| 
      
            Lines 2-18
          
      
      
        Link Here
      
     | 
  
        
          | 2 | 
          #  | 
          2 | 
          #  | 
        
        
          | 3 | 
          # koha-dump: dump all contents and configs for a Koha site  | 
          3 | 
          # koha-dump: dump all contents and configs for a Koha site  | 
        
        
          | 4 | 
          # Copyright 2010  Catalyst IT, Ltd  | 
          4 | 
          # Copyright 2010  Catalyst IT, Ltd  | 
        
          
            
              | 5 | 
              #   | 
              5 | 
              #  | 
            
        
          | 6 | 
          # This program is free software: you can redistribute it and/or modify  | 
          6 | 
          # This program is free software: you can redistribute it and/or modify  | 
        
        
          | 7 | 
          # it under the terms of the GNU General Public License as published by  | 
          7 | 
          # it under the terms of the GNU General Public License as published by  | 
        
        
          | 8 | 
          # the Free Software Foundation, either version 3 of the License, or  | 
          8 | 
          # the Free Software Foundation, either version 3 of the License, or  | 
        
        
          | 9 | 
          # (at your option) any later version.  | 
          9 | 
          # (at your option) any later version.  | 
        
          
            
              | 10 | 
              #   | 
              10 | 
              #  | 
            
        
          | 11 | 
          # This program is distributed in the hope that it will be useful,  | 
          11 | 
          # This program is distributed in the hope that it will be useful,  | 
        
        
          | 12 | 
          # but WITHOUT ANY WARRANTY; without even the implied warranty of  | 
          12 | 
          # but WITHOUT ANY WARRANTY; without even the implied warranty of  | 
        
        
          | 13 | 
          # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the  | 
          13 | 
          # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the  | 
        
        
          | 14 | 
          # GNU General Public License for more details.  | 
          14 | 
          # GNU General Public License for more details.  | 
        
          
            
              | 15 | 
              #   | 
              15 | 
              #  | 
            
        
          | 16 | 
          # You should have received a copy of the GNU General Public License  | 
          16 | 
          # You should have received a copy of the GNU General Public License  | 
        
        
          | 17 | 
          # along with this program.  If not, see <http://www.gnu.org/licenses/>.  | 
          17 | 
          # along with this program.  If not, see <http://www.gnu.org/licenses/>.  | 
        
        
          | 18 | 
           | 
          18 | 
           | 
        
  
    | 
      
            Lines 48-53
          $scriptname -h|--help
      
      
        Link Here
      
     | 
  
        
          | 48 | 
           | 
          48 | 
           | 
        
        
          | 49 | 
              --schema-only         Dump only the database schema  | 
          49 | 
              --schema-only         Dump only the database schema  | 
        
        
          | 50 | 
              --exclude-indexes     Include Zebra indexes on the backup  | 
          50 | 
              --exclude-indexes     Include Zebra indexes on the backup  | 
        
            
               | 
               | 
              51 | 
                  --exclude-logs        Exclude /var/log/koha/name from the backup  | 
            
        
          | 51 | 
              --uploaded_files      Include uploaded files.  | 
          52 | 
              --uploaded_files      Include uploaded files.  | 
        
        
          | 52 | 
              --uploaded_temp_files Include temporary uploaded files.  | 
          53 | 
              --uploaded_temp_files Include temporary uploaded files.  | 
        
        
          | 53 | 
              --quiet|-q            Make the script avoid printing to STDOUT  | 
          54 | 
              --quiet|-q            Make the script avoid printing to STDOUT  | 
        
  
    | 
      
            Lines 123-128
          dump_instance()
      
      
        Link Here
      
     | 
  
        
          | 123 | 
                  output="$output to $metadump"  | 
          124 | 
                  output="$output to $metadump"  | 
        
        
          | 124 | 
                  [ "$quiet" = "no" ] && echo "$output"  | 
          125 | 
                  [ "$quiet" = "no" ] && echo "$output"  | 
        
        
          | 125 | 
           | 
          126 | 
           | 
        
            
               | 
               | 
              127 | 
                      if [ "$exclude_logs" = "yes" ]; then  | 
            
            
              | 128 | 
                      tar -czf "$metadump" -C / $excludes \  | 
            
            
              | 129 | 
                          "etc/koha/sites/$name" \  | 
            
            
              | 130 | 
                          "etc/apache2/sites-available/$instancefile" \  | 
            
            
              | 131 | 
                          "etc/apache2/sites-enabled/$instancefile" \  | 
            
            
              | 132 | 
                          "var/lib/koha/$name" \  | 
            
            
              | 133 | 
                          $uploaded_files_dir \  | 
            
            
              | 134 | 
                          $uploaded_temp_files_dir  | 
            
            
              | 135 | 
               | 
            
            
              | 136 | 
                      chown "root:$name-koha" "$metadump"  | 
            
            
              | 137 | 
                      chmod g+r "$metadump"  | 
            
            
              | 138 | 
                      else  | 
            
        
          | 126 | 
                  tar -czf "$metadump" -C / $excludes \  | 
          139 | 
                  tar -czf "$metadump" -C / $excludes \  | 
        
        
          | 127 | 
                      "etc/koha/sites/$name" \  | 
          140 | 
                      "etc/koha/sites/$name" \  | 
        
        
          | 128 | 
                      "etc/apache2/sites-available/$instancefile" \  | 
          141 | 
                      "etc/apache2/sites-available/$instancefile" \  | 
        
  
    | 
      
            Lines 134-139
          dump_instance()
      
      
        Link Here
      
     | 
  
        
          | 134 | 
           | 
          147 | 
           | 
        
        
          | 135 | 
                  chown "root:$name-koha" "$metadump"  | 
          148 | 
                  chown "root:$name-koha" "$metadump"  | 
        
        
          | 136 | 
                  chmod g+r "$metadump"  | 
          149 | 
                  chmod g+r "$metadump"  | 
        
            
               | 
               | 
              150 | 
                    fi  | 
            
        
          | 137 | 
           | 
          151 | 
           | 
        
        
          | 138 | 
                  [ "$quiet" = "no" ] && echo "Done."  | 
          152 | 
                  [ "$quiet" = "no" ] && echo "Done."  | 
        
        
          | 139 | 
              fi  | 
          153 | 
              fi  | 
        
  
    | 
      
            Lines 144-149
          quiet="no"
      
      
        Link Here
      
     | 
  
        
          | 144 | 
          exclude_indexes="no"  | 
          158 | 
          exclude_indexes="no"  | 
        
        
          | 145 | 
          without_db_name="no"  | 
          159 | 
          without_db_name="no"  | 
        
        
          | 146 | 
          schema_only="no"  | 
          160 | 
          schema_only="no"  | 
        
            
               | 
               | 
              161 | 
              exclude_logs="no"  | 
            
        
          | 147 | 
           | 
          162 | 
           | 
        
        
          | 148 | 
          while [ $# -gt 0 ]; do  | 
          163 | 
          while [ $# -gt 0 ]; do  | 
        
        
          | 149 | 
           | 
          164 | 
           | 
        
  
    | 
      
            Lines 154-159
          while [ $# -gt 0 ]; do
      
      
        Link Here
      
     | 
  
        
          | 154 | 
                  --exclude-indexes)  | 
          169 | 
                  --exclude-indexes)  | 
        
        
          | 155 | 
                      exclude_indexes="yes"  | 
          170 | 
                      exclude_indexes="yes"  | 
        
        
          | 156 | 
                      shift ;;  | 
          171 | 
                      shift ;;  | 
        
            
               | 
               | 
              172 | 
                      --exclude-logs)  | 
            
            
              | 173 | 
                          exclude_logs="yes"  | 
            
            
              | 174 | 
                          shift ;;  | 
            
        
          | 157 | 
                  --without-db-name)  | 
          175 | 
                  --without-db-name)  | 
        
        
          | 158 | 
                      without_db_name="yes"  | 
          176 | 
                      without_db_name="yes"  | 
        
        
          | 159 | 
                      shift ;;  | 
          177 | 
                      shift ;;  |