PDA

View Full Version : CQC Automated Backup


ToyMaster458
04-21-2007, 11:26 AM
I have expanded on IVB scripts for starting and stopping CQC to an automated backup script. This script will Stop the CQC Service and backup the CQC directory to a directory in form of a zip file or using Windows native NTBackup with the date and time of the backup and then restart the CQC Service (Using the /R switch will not restart the service).

To use the 7-Zip feature of this script you need a free file archiver installed on the system and can be downloaded at http://www.7-zip.org with no command line switches.

To use the WinZip feature of this script you will need the Command Line Add-on a long with WinZip installed on the system and can be downloaded from http://www.winzip.com/downcl.htm and add a /W switch to the command. I have found this to be faster then 7-Zip

To use the NTBackup feature of this script add a /N switch to the command. This also takes twice as long to backup.

The default Backup Path is "C:\Backup". You can override this path using the /D switch in the following format /D:"New Path", for example /D:"E:\CQC Backups". You must enclose the path with quotes.

Current Version 0.8
CQCBackup.cmd ([/N] [/W]) ([/D:"Path"]) ([/R])

Version Notes:

0.1 - First Public Beta Release
0.2 - Fix Time Stamp in File Name
0.3 - Added support for NTBackup using the /N switch
0.4 - Added support for WinZip using the /W switch
0.5 - Added a /R switch that will not restart the CQC Service
0.6 - Added a /D switch to override the Backup Path
0.7 - WinZip would not run if backup path did not exist. I now check if the path is there and if not I create it.
0.8 - Backup failed if path included spaces. I now handle paths with spaces.

ToyMaster458
04-21-2007, 11:34 AM
I found a bug in the time format and uploaded a new version

IVB
04-21-2007, 11:42 AM
that is awesome, thanks for doing that, the recent thread had me about to determine how to do this tonight.

ToyMaster458
04-21-2007, 11:47 AM
With the new betas coming out the biggest pain in the butt was the backups. I plan on adding some more features like being able to point where to save the backup via command line. And if Dean ever adds command switches to the install I will be able to run a silent setup on the clients after the backup runs.

The only issue I see is if any CQC interfaces are open it will not backup that exe.

znelbok
04-21-2007, 01:34 PM
This script uses a free file archiver

Every xp and W2K has backup as an option under system tools. This can be started from a command line so it would remove the need for an external program to be installed. That may be a better option.

Mick

ToyMaster458
04-21-2007, 01:44 PM
I suppose I might be able to add a command line switch to choose which one you want to use.

ToyMaster458
04-21-2007, 08:26 PM
Every xp and W2K has backup as an option under system tools. This can be started from a command line so it would remove the need for an external program to be installed. That may be a better option.

Mick
I just add this feature. Are we all a happy camper now??:-D
Just a FYI, the NTBackup takes twice as long as the 7-Zip and 7-Zip is free.

znelbok
04-22-2007, 03:47 AM
It was just a comment to give an option to use something that already exists on most systems (which is my preference).

For those that have winzip there is a command line add-on as well that will give a similar result - many ways to skin a cat!!

I have never compared times - that is a surprise. What is the compression ratio like between them (if there is any)

Mick

ToyMaster458
04-22-2007, 07:39 AM
The NTBackup also produces a larger file. I will take a peek at Winzip and see if I can not add that as well.

ToyMaster458
04-22-2007, 08:19 AM
For those that have winzip there is a command line add-on as well that will give a similar result - many ways to skin a cat!!
Mick
There is another cat skined!! :-D

zaccari
04-22-2007, 09:46 AM
I just wish stopping the service didn't kill my global variables.

Russ...

ToyMaster458
04-22-2007, 07:05 PM
I added a /R switch that will NOT restart the CQC Service after the backup.

zaccari
04-22-2007, 07:50 PM
What good is it if the service doesn't start back up? Then nothing works. I must be misunderstanding what you mean.

Russ...

ToyMaster458
04-22-2007, 07:56 PM
With out the /R switch it will restart. But for any reason you want to back it up and keep it off line you can. For example if you do a upgrade, you can backup, keep it off line, and then run the upgrade and do not have to wait for the upgrade to shut it down again.

Dean Roddey
04-22-2007, 08:12 PM
One of these days I'm going to add a backup to the installer, so that it offers to do a backup for you after it stops the service but before the new install. It already creates a backup directory actually, the SaveInst directory. It would just ask you where you want to put it and give it a name based on stuff like CQC version and date and so forth.

ToyMaster458
04-23-2007, 06:47 AM
Is there a way to get the CQC version from the command line? It would be nice to include this information in the file name of the backup I am doing now.

Dean Roddey
04-23-2007, 10:06 AM
Not really. It's in the registry so if there's some tool that can pull a registry value out and return the value as its output, that might work.

ToyMaster458
04-23-2007, 10:33 AM
Where in the Reg? On a client machine I looked in HKEY_LOCAL_MACHINE\SOFTWARE\Charmed Quark Software and only found the install path.

Sendero
04-23-2007, 10:47 AM
Looks liek the /d param isn't working. It always goes to c:\backup. Did you disable the param by commenting out this line?
REM for %%p in (%par1% %par2% %par3%) do if /i FINDSTR.exe /C:"/d" "%%p" Call :GetPath

Dean Roddey
04-23-2007, 10:49 AM
Like I said, the only think in the registry is the install path, and all these people who say that the version is there don't know what they are talking about!

ToyMaster458
04-23-2007, 11:18 AM
Looks liek the /d param isn't working. It always goes to c:\backup. Did you disable the param by commenting out this line?
REM for %%p in (%par1% %par2% %par3%) do if /i FINDSTR.exe /C:"/d" "%%p" Call :GetPath

The /D switch is still in development.

ToyMaster458
04-27-2007, 03:12 PM
Looks liek the /d param isn't working. It always goes to c:\backup. Did you disable the param by commenting out this line?

I have finished the /d param in version 0.6 that is now uploaded.

ToyMaster458
04-27-2007, 08:52 PM
I found a couple of bugs and uploaded version 0.8

Please let me know if there are any other features needed or wanted and if you find any other bugs. If not I will release this as version 1.0

ToyMaster458
05-03-2007, 05:03 PM
I have officialy released the current beta 0.8 as 1.0
http://www.charmedquark.com/vb_forum/showthread.php?t=4379