BackupToZip 1.1 build: 9357 released: 2009-05-18 Maintains a backup mirror of a set of files in a single ZIP file using TrueZip.. Copyright (c) 2010 Canadian Mind Products. Java application. Download from http://mindprod.com/products1.html#BACKUPTOZIP ===> Free <=== Full source included. You may even include the source code, modified or unmodified in commercial programs that you write and distribute. May be used freely for any purpose but military. For more details on this restriction, see http://mindprod.com/contact/nonmil.html If you include any Canadian Mind Products code in your own applications, your app too must be labeled non-military use only. All Java jars and source code are included. ---- Prerequisites: This program runs under any OS, (e.g. Win2K/XP/Vista/W7x86/W7-64/OSX/Linux/Solaris/AIX...) so long as you have <><> Java version 1.6 <><> or later installed (32-bit or 64-bit Java). See http://mindprod.com/jgloss/installingjava.html for details. ---- Installing on a PC: Download source and compiled class files to run on your own machine as an application. First install a recent Java JDK or JVM. See http://mindprod.com/jgloss/installingjava.html. To install, extract the zip download with WinZip (or similar unzip utility) into any directory you please, often J:\ -- ticking off the "use folder names" option. To run as an application,type: java -jar J:\com\mindprod\backuptozip\backuptozip.jar parms adjusting as necessary to account for where the jar file is. ---- Installing on a MacIntosh: Use Safari to download source and compiled class files to run on your own machine as an application. Safari will automatically unpack the zip into ~/Downloads (version 10.5) [or on the Desktop (version 10.4 and earlier)]. First install a recent Java JDK or JVM. See http://mindprod.com/jgloss/installingjava.html. You may optionally move the download tree to a permanent home. I don't have a MacIntosh, just a PC, so I can't test my Java programs for Mac compatibility. In theory they should work without problems, but in practice that does not always happen. If you have problems please, let me know, preferably with screenshots and complete verbatim error messages. To run as an application, without parameters, just double click the jar file. To run as an application with parameters, in bash shell type: open Terminal.app cd ~/Desktop java -jar com/mindprod/backuptozip/backuptozip.jar parms adjusting as necessary to account for where the jar file is. ---- Rebuilding: The zip already contains the necessary class and jar files, so unless you modify the program, there is no need to recompile the source or rebuild the jar. Configure.java basedir="E:/" in rebuild.xml to the drive where your files are. Use ANT and rebuild.xml, not build.xml, to recompile and recreate the jar. ---- Use: BackupToZip is a simple backup program. It maintains a compressed mirror of a set of files in a single large ZIP file. You can then copy this ZIP file to DVD, flash drive, hard disk or CD for backup. Unlike a compression utility, such as WinZIP, if you delete files, the next time you run BackupToZip it will automatically delete those deleted files from the backup archive. It will also automatically update changed or add new files as needed. To restore, you would use a conventional ZIP tool such as WinZIP to fetch replacements for the damaged files from the archive. BackupToZip is much faster than recreating the archive from scratch each time with WinZIP. It also avoids the usual problem of gradually accumulating more and more junk in your backup archive files that have long been deleted from your actual files. With an ordinary archiving utility, come time to restore, you have to manually sort through the accumulated chaff. vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv You must first install the truezip-6.jar available from https://truezip.dev.java.net/. You must first put a copy of it in each of your Java or Jet ext directories. Without it your cannot compile or run BackupToZip. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Put a copy of the TrueZip jar in the JRE at: C:\Program Files\Java\jre6\lib\ext and, if you have the JDK installed put another copy at: E:\Program Files\Java\jdk1.6.0_18\jre\lib\ext then type: java -jar backuptozip.jar C:\keep\store.zip -q -s E:\important F:\stuff Where store.zip in the name of the archive where you want to create the mirror. The archive need not exist to start. You can pick any name you want so long as it ends in .zip E:\important F:\stuff etc. are directory trees you want to back up. -q means quiet -- suppresses voluminous status information about the files selected. -s mean and subdirectories too, recursively. The first time you invoke BackupToZip it will take a fair bit of time. Every time thereafter will be much faster since it will only have to compress the files that have changed. Verify that all the files you vanted are present in the archive file with WinZip or other Zip utility. It is fairly easy to forget or misspell one of the directories, or to forget a -s option to include subdirectories or to include subdirectories you did not want. It is also easy to leave off the quote marks around files with embedded spaces in their names like "F:\Program Files\SomeProg\SomeFile.ini". You won't get an error message. Your file will be quietly left behind. I REPEAT, please, PLEASE, verify that all the file you thought you were backing up are inside the ZIP. When it comes time to restore, if the files you need are not there, there is nothing you can do to recover. Be aware that if you change the command line, any files NOT mentioned on the new command line will be automatically deleted! You don't have to start from scratch. Note that you can't add to the archive with several different command lines. If your command line gets too long, use two separate archive files and two separate groups of files to backup. I repeat. BackupToZip does not do anything to get the archive copied to DVD and offsite. That is totally up to you after BackupToZip has run. It does nothing to restore files after a crash. It is up to you to use some zip-compatible compression utility, to manually restore whatever files you need from the zip archive on backup media. See http://mindprod.com/jgloss/compressionutilities.html for possible tools. Because BackuptoZip creates a vanilla zip file, you can restore it on any computer with any OS. You don't even need to install BacktoZip to restore. With Vista, you don't need to install any software at all to restore. It does not bother backing up junk files such as: *.aps, *.bak, *.csm, *.dmp, *. ilk, *.log, *.lst, *.map, *.ncb, *.obj, *.pch, *.pdb, *.temp, *.tmp, temp.*, temp1.*, temp2.*, delete_me To change that list you would have to modify the source and recompile the program. The program has three main disadvanges: (1) The main disadvantage of BackupToZip is it has no feature to split the ZIP files into pieces each big enough to fit on a DVD or CD. Either you must must select a set of files to bacu up to each each archive that will fit on a DVD/CD or you must use a smart backup progam that can split the archives over more than one DVD/CD. (2) The secendimportant disadvantage is BackupToZip does not yet have a mechanism to specify directories, files and extensions to exclude. (3) The third important disadvanage is BackupToZip does not have a way to specify a long list of directories and files to backup in a file. You must squeeze then all on the command line. I plan to rectifiy (2) and (3) in the coming months with a unified constelation system for specifying files that will work with all Canadian Mind Products utilities. Note the program is called BackupToZip not Back2Zip or BackToZip much as I would like to honour Michael J. Fox, a local boy who starred in Back to the Future. You will get faster response if you use a number of smaller backup zips rather than one big one. This is there is nothing to do if none of the files in one of the zips have changed. Further is in faster to rearrange a small jar to accomodate the additions, updates and deletions. ---- Restoring From Backup To restore, use any zip utility such as winzip. e.g. rem recover pad files from hot backups. rem extract files from backup. rem WinZip is the Winzip archiver from WinZip.com. rem -e mean extract (copy files from archive) rem -o means overwrite old files without prompt rem G:\bks\website.zip is the name of the hot backup created with BackuptoZip. rem E:\mindprod\pad is where restored files will go rem mindprod\pad\*.xml and mindprod\pad\*.html are files to recover. (without drive letter) wzunzip -e -o G:\bks\website.zip E:\mindprod\pad mindprod\pad\*.xml mindprod\pad\*.html Why the worried elephant icon? The elephant is fabled never to forget. I wanted to remind everyone to remember to backup their files with BackupToZip. ---- Version History: 1.0 2009-05-16 - initial release. 1.1 2009-05-18 - Update the last modified date of the achive if changed. TrueZip does not do it automatically. -30-