BCS Zip Creation From File List


To successfully back up sizable quantities of data I have found using 7 zip with the volume option allows me to span zip content size to the maximum capacity of a single sided DVD.
z701
 
By employing this utility you can check for the successful creation of the zipped output file.  After determining the zip is acceptable the identical file list can be used to delete the folders and files contained in the newly created zip.  This feature supplies the move to zip feature in a flawless two step process.
Initially the end user is prompted to select the subject folder for the zip.  This process performs a top level directory and file retrial (without recursion).  The directories are all modified to include the trailing slash at the end of the directory specification.  This signals 7 Zip to process the specification as a directory.  For all directory specifications recursion and inclusion of the entire contents of detected folders is achieved.
Then all files encountered are added to the file list.
z702
A set of default parameters exists on the Application Default tab as depicted below.
z704
When the Create New Zip From File List Option is invoked the following dialog appears.
z707
Once the directory is selected the following dialog will appear.
z708
If you click the Yes option the following dialog will appear.
z709
Hold the control (Ctrl) key and use the mouse to click on the items to be deleted from the list.
After the selections are complete click on the OK control to create the zip.
The following dialog will appear prompting you for a description of the zip.
z710
Key in a description and click the OK button.  The following dialog will appear.
z711
As you can see the newly created zip has been cataloged a the contents are also stored in the database.
At this point you are free to try another Primary Option Menu item.
When you click on the View Zip Jobs menu item the following dialog appears.
z711
When the Open Zip menu option is selected from the Primary Options Menu the following dialog appears prompting you for the zip file to open.
z712
As you can see the 7 Zip file manager GUI is invoked and the user is free to utilize the zip in the desired manner.  Remember all deletes are final.
z713
When you click on the View And Extract Zip File Database menu item of the Primay Options Menu the following dialog appears.  Click on the Select Files To Extract menu item after invoking the popup menu item.
z714
When you click on the Select Files To Extract pop up menu item the following dialog will appear.
z715
Press the control (Ctrl) key and move he mouse over the desired items and click while holding the control key.  You can traverse the list and highlight as many files as you would like to extract.  Finally invoke the popup up menu over the selected items and select the Extract Contents menu item.
z716
This dialog prompt the user for the target of the extracted files.  When he user selects the extract target directory the files selected are extracted to that location.
At this point you can click on any Primary Options Menu items and utilize this utility.
A MySQL database was created and added to maintain file lists of every backup produced using this tool.  The component parts consists of:
Date and time
Description
Directories Contents
Files Contents
Comprehensive List of Zip Content
A master detail scenario has been added that tables the contents of the zip.  A zip list is produced, read and adds records to the master detail so by archive the contents of the zip is listed.  This feature is also helpful with trying to locate a specific file or sub directory.
Here is a script to establish the MySQL table after the appropriate database has been created.
[codesyntax lang=”sql”]

-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Apr 02, 2016 at 09:34 PM
-- Server version: 5.6.17
-- PHP Version: 5.5.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `dbbk`
--
-- --------------------------------------------------------
--
-- Table structure for table `bkup`
--
CREATE TABLE `bkup` (
 `id` int(11) NOT NULL,
 `bkdt` varchar(30) NOT NULL,
 `des` varchar(75) NOT NULL,
 `dirs` mediumtext NOT NULL,
 `files` mediumtext NOT NULL,
 `filelist` mediumtext NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `dt`
--
CREATE TABLE `dt` (
 `id` int(11) NOT NULL,
 `mid` int(11) NOT NULL,
 `fname` varchar(255) NOT NULL,
 `fdat` datetime NOT NULL,
 `osize` bigint(20) NOT NULL,
 `csize` bigint(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `mt`
--
CREATE TABLE `mt` (
 `id` int(11) NOT NULL,
 `zname` varchar(255) NOT NULL,
 `zosize` bigint(20) NOT NULL,
 `zcsize` bigint(20) NOT NULL,
 `filecnt` int(11) NOT NULL,
 `dircnt` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Indexes for dumped tables
--
--
-- Indexes for table `bkup`
--
ALTER TABLE `bkup`
 ADD PRIMARY KEY (`id`);
--
-- Indexes for table `dt`
--
ALTER TABLE `dt`
 ADD PRIMARY KEY (`id`);
--
-- Indexes for table `mt`
--
ALTER TABLE `mt`
 ADD PRIMARY KEY (`id`),
 ADD UNIQUE KEY `zname` (`zname`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `bkup`
--
ALTER TABLE `bkup`
 MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT for table `dt`
--
ALTER TABLE `dt`
 MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `mt`
--
ALTER TABLE `mt`
 MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

[/codesyntax]
An associated report is also produced and indicated in the example below;
z703
Below is an example of the zip contents report.
z704
You can easily extract archived elements to a location you specify, (original location or new location) by using this tool.
Under the Primary Options menu select Zip Con (zip contents) menu item.  Select the desired archive from the Master Grid tab.
Position the database to the desired archive and tap on the grid (only once).  Invoke the pop up menu on the Detail Grid then select the Process Details menu item.  The next dialog will contain the contents of the archive.
z705
To select multiple items to be extracted simply hold the Ctrl (control) key and click on each item.
This tool then dynamically build a include file list that identifies which items to extract per the previous dialog.
Invoke the pop up menu on the above dialog and select the Extract Contents menu item.  Finally this tool invokes 7 Zip and extracts the the destination location you selected during the Extract Contents action.
An example of the dialog that prompt you for the target extraction location appears below.
z706
A 32 bit executable program may be downloaded by clicking here.
A 64 bit executable program may be downloaded by clicking here.
The component documentation can be found by clicking here.
The source code may be found by clicking here.
Mr. Arch Brooks, Software Engineer, Brooks Computing Systems, LLC authored this article.

Leave a Reply

Your email address will not be published. Required fields are marked *