Friday, November 26, 2010

How important is your Vault data? Part2

In our previous post we discussed some of the issues of protecting your Vault data, and highlighted the advantages of using ADMS backups.
What we wanted to do know is give you an example of an ADMS script, break it down so you can see how it works, and then give you  helpful little utility to make it all the better.
In the Advanced Configuration Guide (all versions available from Advanced Configuration Guide for Autodesk data management server) you will find "Configuring Automatic Backups" and there it will describe how to set  up a scheduled task, and it also gives and example batch file.
If we all had endless supplies of disk space, then using a cascaded backup would be no issue. Unfortunately for most users this is not the case.
Also the example makes no account of errors, so that if the backup script shown fails for 2 nights, there would be no backup left to go back to (on the 1st night B would be deleted and A moved to B, on the second night B would be deleted and there would be no A).
So we have done a little bit of work on the script , here it is with section explanations
First we set up variables. This means if we want to change the Backup folder from C: to D:, we need only change the set VltFld line to handle this
@echo off
REM **Set vault Folder reference
set VltFld=C:\Vault
REM **SET Backup Folder Names
REM **Set vault Backup root Folder reference
set VltBckFld=%VltFld%\Backups
REM **Set vault Backup Temp Folder reference
set VltBcktmpFld=TMP
REM **Set vault Backup Target Folder reference
set VltBckTgtFld=A
REM **Set vault Backup Cascade  Folder reference
set VltBckCscFld=B
REM **Set vault Logs  Folder reference
set VltLogFld=%VltFld%\Logs
REM **Set Temp Backup Log
set TmpLogFile=VaultBackupTmp.log
REM **Set Target backup log
set TgtLogFile=VaultBackup.log
When a Vault backup is run, a folder called VaultBackupxxxxxxxx is created, where the xxxxxxx is today's Date and time. this means we never know what the folder is going to be called. By housing the backup in a Folder we definitely know the name of, we can then control its deletion and creation. So we Create folders A & B to hold the last and last but one backup
At this point we remove the Cascaded backup folder. If you are going to run a one backup folder system, Either REM the  rmdir /Q /S %VltBckFld%\%VltBckCscFld% and the later line ren %VltBckFld%\%VltBckTgtFld% %VltBckcscFld% that moves the old A to B
REM **Remove and the Cascaded Backup
rmdir /Q /S %VltBckFld%\%VltBckCscFld%
If the last backup failed for some reason, we may still have our temp holding folder that we need to get rid of.
REM **Remove (in case) and recreate temp Holding Folder for Backup
rmdir /Q /S %VltBckFld%\%VltBckTmpFld%
mkdir %VltBckFld%\%VltBckTmpFld%
We get rid of any old log files
REM **Delete old Log files
del %VltlogFld%\%TmpLogFile%
del %VltlogFld%\%TgtLogFile%
Now run the vault backup to our temporary folder. By creating a log file, we can later test to see if the backup finished or crashed out
REM **Backup up to temp folder location and to temp log file
"C:\Program Files\Autodesk\ADMS 2011\ADMS Console\Connectivity.ADMSConsole.exe" -Obackup -S -DBSC -B%VltBckFld%\%VltBckTmpFld% -VUAdministrator -VP -L%VltlogFld%\%TmpLogFile%
We check to see if the backup log file was created. this gives us a decent check on whether the backup managed to run. If there was an error but the log file was created, we will see this in the log contents.
REM **If the backup failed, there will be no log folder,
IF EXIST %VltlogFld%\%TmpLogFile% GOTO SUCCESS
REM **If we are here, the backup failed, pass in the excpected log file,
REM **the email script will see this is missing
REM **and react accordingly
call EmailLogs.bat %VltlogFld%\%TgtLogFile%
GOTO FINISH
If the backup succeeded we can rename folders and log files (as mentioned previously, if not using a cascaded backup, REM out the A to B line)
:SUCCESS
REM **Rename backup folders
REM **Rename A to B
ren %VltBckFld%\%VltBckTgtFld% %VltBckcscFld%
REM **Rename TMP to A
ren %VltBckFld%\%VltBckTmpFld% %VltBckTgtFld%
REM **Rename Backup Log
ren %VltlogFld%\%TmpLogFile% %TgtLogFile%
call EmailLogs.bat %VltlogFld%\%TgtLogFile%
GOTO FINISH
:FINISH

You will notice the 2 lines in the above that call EmailLogs.bat. this is a second batch file that handles informing the user of the status of the backup. To do the emailing you can use programs like Blat, but we have seen some issues with Exchange 2007, so we have written our own little mailer, CPS.MiniMailer to handle this task. You are welcome to use this and let us have feedback on any issues.

The MiniMailer config file (CPS.MiniMailer.exe.config) contains sections for all the below. By setting them in the config, you can omit them from the batch file (see this post Command Line Mailer for fuller explanation on this)

@echo off

:::::::::::::: Lets set some variables ::::::::::::::
REM **Apart from the attachment, the rest of these variables
REM **can be set in teh mini mailer configuration if required
set attach=%1
set eMailto=-t greg.h@cadpro.co.nz
set eMailfrom=-f greg.h@cadpro.co.nz
set subj=-sub "Vault Server Backup Log"
set server=-srv 192.168.88.1
set body=-b "Vault Backup Log File"
 We try to find the log file (which was passed as the 1st parameter to the batch file)
::::::::::::::::: Now we run Email Sender:::::::::::::::::
IF EXIST %attach% GOTO MAILLOG
REM **Rest teh subject to an error ttype
set subj=-sub "Vault Server Backup Error"
"CPS.MiniMailer.exe" %eMailto% %eMailfrom% %subj% %body% %server% 
GOTO FINISH
:MAILLOG
"CPS.MiniMailer.exe" %eMailto% %eMailfrom% %subj% %body% %server% -a %attach% 
:FINISH
What you should find is that when you run the VaultBackup.bat file, you should get an email upon completion. If the process failed (which is easily simulated by leaving ADMS console open and running the batch file) you will see a subject of "Vault Server Backup Error", if it completes you will have a copy of the log file attached.
You can download the batch files and command line mailer from here Vault Backup Utilities 
The above are by no means the last word on this subject, but hopefully they give you some ideas and start points for you to move on from.


Command Line Mailer

For a lot of situations, a command line emailer comes in really useful

In the past I have used Blat, which has suited my needs perfectly. However in recent times, I have had more and more issues with Exchange and firewalls, so decided to see if I could write one for my needs.
And so came about CPS.MiniMailer. Its not very sophisticated (yet) but it does allow me to send mails through our Exchange 2008 server, as well as Google Mail.
Heres a breakdown of the switches

CPS.MiniMailer.exe
-hDisplays list of switches
-srvSMTP server address or name
-pSMTP Port number
-tMail To (multiple addresses separated by commas
-fMail From
-subSubject (enclose sentence in double quotes)
-bBody (if HTML mail, can be html formatted string)
-duDomain user (Exchange) or user name (GMail etc)

-dppassword for -du
-html1 for HTML formatted mail, 0 for plain text
-aAttachments, surround paths with double quotes, multiple files separated by comma's
With the mailer comes a config file, CPS.MiniMailer.exe.config and all the above values (apart from attachments) can be preset there, really useful for Mail server and user name. However if you pass in a switch, this will override the config value with your switch one, really useful for subject, body etc.
To edit the config file, open it into notepad, and find the relevant setting (so for the From setting we would look for <setting="From" serializeAs="String"> )and then edit the the text between the <value> and </value> tags.

An example of a command line (or batch file) using GMail is
CPS.MiniMailer.exe -srv smtp.gmail.com -p 587 -f mylogin@gmail.com -t blogs@cadpro.co.nz -sub "Test Gmail Mail" -du mylogin@gmail.com -dp myPassword
And for exchange

CPS.MiniMailer.exe -srv myExhcnageSrv -p 25 -f myname@mycompany.com -t blogs@cadpro.co.nz -sub "Test ExchangeMail" -du myDomainName -dp myDomainPassword

You can download the mailer from CADPRO Systems MiniMailer Utility

Please post any questions or comments, and when changes are made we'll append to this blog

Friday, November 19, 2010

How important is your Vault data?

When looking at any design, one of the costliest items involved is creating the design data. Whether that be 3D Models, 2D Drawings or any other supporting documentation, it all takes time to create and therefore has a value. Safeguarding that data should be of paramount importance and members of most organisations will have IT resources that handle this. For smaller outfits (especially contractors) this a task that gets done whenever it is remembered and is seen as more of a necessary evil. (The important word here is necessary).

There are many programs out there to handle backing up of data (Microsoft have their built in Windows Backup for small users, then Backup Exec, Veritas etc. for server backups) but when it comes to Vault there are some issues with backing up the SQL databases, as these are seen as in use files, and unless you have a SQL agent for you backup software, the all important databases will be missing when you come to restore. And if you do have SQL agents, once all files are restored there are permissions and passwords to be sorted out.

Enter the Autodesk Data Management Server (ADMS)  console backup. This gives a dataset that can be easily restored through the ADMS console. When this is done, ADMS sorts out all the permissions and passwords (and can even relocate databases and file stores in the event of disk reconfiguration).

So why doesn't everyone use ADMS Backup? Well there is one issue and that’s space. The backup dataset consists of SQL backups of the Vault databases, and a replica of the file store, thus a double up of your working data. This can be a stumbling block for many IT resources, as it’s extra “wasted” disk space that could be used for other tasks, or needs to be purchased.

However, when we look at the title of this article, is that disk space more important than the years of design data it could be protecting?

Another factor to consider when planning you data protection is disaster recovery (DR), a subject close to many  New Zealanders hearts with recent earthquake activity. Disaster recovery should be planned for a disaster, so not just replacing a data disk, but an entire server replacement. Simulate this by trying to recover your data to a whole new server (with machine virtualisation these tests are much easier to carry out than before). Not only will this give you a procedure to follow, but it is a good test of your backup validity. Try and run a DR simulation at least once a year, just to keep testing recovery from those backups (usually a really good idea just before upgrade time)

In our next article, we’ll look at Vault backup strategies and scripts, along with some interesting use of batch files.

Its in the Cloud

No not an All About Eve song (for those old enough to remember) but Inventor Optimisation technology Preview 4.
In a nutshell, Inventor Optimisation lets you run FEA simulation on parts and assemblies, taking into account multiple configurations of feature sizes. this enables the designer to find out optimal materials and sizes to minimise  boundary conditions whilst still meeting all design criteria.
"But my machine hasn't got the power for that" I hear you cry. Fear not, as the calculations are all Cloud based, no processing is done on your PC (in fact you can shut Inventor down and carry on other tasks while the analysis is running.)
"But I've not got Inventor Simulation or Pro" I hear you cry further. Again no fear, Inventor Optimisation preview will run in Inventor Suite 2011 as well as Inventor Professional 2011

If the above hasn't done enough to gain your interest check out this video Inventor Optimisation TP 4 and goto to labs to download Inventor Optimization on Autodesk Labs

Monday, November 15, 2010

Share your Vault Settings

Wouldn't it be nice if you could share your Vault searches with other users, and also make sure you have a backup copy so that if your PC blows up, or after an upgrade you still have your default settings.
Well Doug Redmond has been working on this very thing, enter Project Thunderdome. This nifty little utility will allow you to store and share your searches and plugins for use with other usres as well.
Check out Doug's blog, All Just Ones and Zeros, or go straight to Project Thunderdome

Tuesday, November 2, 2010

When did I check that in?

We are getting quiet a few enquiries on the Check in date reading 01/01/0001.


So it seems Are Autodesk.
We have seen this date only on files that have been checked out, when they are checked back in again the date is formatted correctly. Autodesk have a blog thread here Check in date is wrong.
If you experience any problems with this then please let us know (post to this thread).