MoveAndGoLive - File copy/activation not working

Post Reply
jamon
Posts: 163
Joined: Wed Jun 26, 2002 9:35 am

MoveAndGoLive - File copy/activation not working

Post by jamon »

I have a vortex script called MoveAndGoLive. This enables me to respider my site from one box, but then copy the resulting files from the db1 or db2 directories on that box a dbtemp directory on another box, then run this program to do the following: determine which is currently live (db1 or db2),
copy the dbtemp files to the non-live directory, and
then flip the switch, making the other directory (with the new files) live.

It used to work fine. Now it doesn't. I'm wondering if this is another symptom of the newer version of Webinator, for which I mistakenly applied the vfpatch, when I shouldn't have.

But, I tested running with the copy of texis that's in the install directory, and it still doesn't work.

Here are the details:

Version of Texis in the install dir:
Texis Web Script (Vortex) Copyright (c) 1996-2003 Thunderstone - EPI, Inc.
Commercial Webinator Version 4.02.1046967833 of Mar 6, 2003 (i686-intel-winnt-32-32)

Version of Texis in the cgi-bin dir:
Texis Web Script (Vortex) Copyright (c) 1996-2002 Thunderstone - EPI, Inc.
Commercial Webinator Version 4.02.1031937844 of Sep 13, 2002

I tried both of those, with the same/similar results.

MoveAndGoLive.bat:
REM ===============================================
REM File: MoveAndGoLive.bat
REM Purpose: Copy New files from dbtest to
REM db2 or db1, and flip the active
REM db to the one just copied.
REM ===============================================
d:\thunderstonesoftware\webinator\texis.exe -r -e MoveAndGoLive_errors.log "d:\thunderstonesoftware\moen\scripts\MoveAndGoLive"

MoveAndGoLive (Vortex):

<SCRIPT LANGUAGE=vortex>
<TIMEOUT=-1></TIMEOUT>
<!--
--------------------------------------------------------------------
File: MoveAndGoLive

Purpose: Webinator DBs are rewalked on one machine, and then the
resulting updated DB files are copied to the production
machine, into a temporary directory. We have to clear
out the receiving directory, copy the files from the temp
directory to the receiving directory, and then flip the
switch from the old active directory to the new one.

History:
15-Jan-2003 jamon Changed Copyright for 2003
jamon Activated for all profiles
jamon Remove trailing / from dest_dspace
21-Oct-2002 jamon Added "glob" to the <sysutil delete...
jamon Added this file header.
16-Oct-2002 jamon New file

--------------------------------------------------------------------
(c) 2002-03 Moen Incorporated
All code is the property of Moen Incorporated
--------------------------------------------------------------------
-->

<A NAME=main public>
<vxinfo installdir>
<sum "%s" $ret "/texis/">
<$defaultdir=$ret>

<!-- For each primary profile: -->
<!-- Go get the current live directory (db1 or db2) -->
<!-- Set variables for source and destination for the copy -->
<!-- Do the copy -->
<!-- Flip the switch -->

<$testdbdir="TestDB">
<sum "%s" $defaultdir $testdbdir>
<$testdb=$ret>

<$profiles= "Consumer" "Builder" "Designer" "Plumber" "Retailer" "Remodeler" "Wholesaler" "MechanicalEngineer" >
<!-- $profiles= "Builder" -->
<loop $profiles>
Profile: $profiles
<sql db=$testdb "select String from options where Profile=$profiles and Name='SS_db'">
Active Directory: $String
<$active_dir = $String>
<$source_dir = $String>
<$dest_dir = $String>
</sql>
<strstri "db1" $active_dir>
<if $ret ne -1>
<sandr "db1" "dbtemp/*" $source_dir>
<$source_dir=$ret>
<sandr "db1" "db2" $dest_dir>
<$dest_dir=$ret>
<sandr "/db2" "" $dest_dir>
<$dest_dspace=$ret>
<else>
<sandr "db2" "dbtemp/*" $source_dir>
<$source_dir=$ret>
<sandr "db2" "db1" $dest_dir>
<$dest_dir=$ret>
<sandr "/db1" "" $dest_dir>
<$dest_dspace=$ret>
</if>
Source Directory: $source_dir
Destination Directory: $dest_dir
Destination Dataspace: $dest_dspace
<sum "%s" $dest_dir "/*">
<$deletepath=$ret>
<sysutil del glob $deletepath>
<$errstring=$ret>
<if $errstring eq "">
<sysutil copy glob $source_dir $dest_dir>
<$errstring=$ret>
<if $errstring eq "">
Flipping Switch...
<sql db=$testdb "update options set String=$dest_dir where Profile=$profiles and Name='SS_db'">
Directory String: $String
</sql>
<if $loop eq 0>
Error: Unable to switch the $profiles profile to $dest_dir.
<else>
Done: Switched the $profiles profile to $dest_dir.
</if>
<sql db=$testdb "update options set String=$dest_dspace where Profile=$profiles and Name='SS_dataspace'">
Dataspace String: $String
</sql>
<if $loop eq 0>
Error: Unable to switch the $profiles dataspace to $dest_dspace.
<else>
Done: Switched the $profiles dataspace to $dest_dspace.
</if>
<else>
Copy Failed - not flipping switch.
Error: $errstring
</if>
<else>
Delete of $deletepath failed.
Error: $errstring
</if>
=========================
</loop>
</A> <!-- end main -->

</SCRIPT>

Output from the program run: (Note: this doesn't change from one run to the next, so it's apparently not flipping the switch either.)


D:\ThunderstoneSoftware\Moen\Scripts>REM ===============================================

D:\ThunderstoneSoftware\Moen\Scripts>REM File: MoveAndGoLive.bat

D:\ThunderstoneSoftware\Moen\Scripts>REM Purporse: Copy New files from dbtest to

D:\ThunderstoneSoftware\Moen\Scripts>REM db2 or db1, and flip the active

D:\ThunderstoneSoftware\Moen\Scripts>REM db to the one just copied.

D:\ThunderstoneSoftware\Moen\Scripts>REM ===============================================

D:\ThunderstoneSoftware\Moen\Scripts>REM d:\wwwmoencom\cgi-bin\texis.exe -r -e MoveAndGoLive_errors.log "d:\thunderstonesoftware\moen\scripts\MoveAndGoLive"

D:\ThunderstoneSoftware\Moen\Scripts>d:\Thunderstonesoftware\webinator\texis.exe -r -e MoveAndGoLive_errors.log "d:\thunderstonesoftware\moen\scripts\MoveAndGoLive"

<!-- Texis RDBMS Copyright (c) 1992 - 2003 Thunderstone - EPI, Inc. -->
<!-- Texis Web Script Copyright (c) 1996 - 2003 Thunderstone - EPI, Inc. -->




Profile: Consumer
Active Directory: d:\ThunderstoneSoftware\Webinator/texis/Consumer/db1
Source Directory: d:\ThunderstoneSoftware\Webinator/texis/Consumer/dbtest/*
Destination Directory: d:\ThunderstoneSoftware\Webinator/texis/Consumer/db2
Flipping Switch...
Profile: Builder
Active Directory: d:\thunderstonesoftware\webinator/texis/Builder/db2
Source Directory: d:\thunderstonesoftware\webinator/texis/Builder/dbtest/*
Destination Directory: d:\thunderstonesoftware\webinator/texis/Builder/db1
Flipping Switch...
Profile: Designer
Active Directory: d:\thunderstonesoftware\webinator/texis/Designer/db1
Source Directory: d:\thunderstonesoftware\webinator/texis/Designer/dbtest/*
Destination Directory: d:\thunderstonesoftware\webinator/texis/Designer/db2
Flipping Switch...
Profile: Plumber
Active Directory: d:\thunderstonesoftware\webinator/texis/Plumber/db1
Source Directory: d:\thunderstonesoftware\webinator/texis/Plumber/dbtest/*
Destination Directory: d:\thunderstonesoftware\webinator/texis/Plumber/db2
Flipping Switch...
Profile: Retailer
Active Directory: d:\thunderstonesoftware\webinator/texis/Retailer/db2
Source Directory: d:\thunderstonesoftware\webinator/texis/Retailer/dbtest/*
Destination Directory: d:\thunderstonesoftware\webinator/texis/Retailer/db1
Flipping Switch...
Profile: Remodeler
Active Directory: d:\thunderstonesoftware\webinator/texis/Remodeler/db1
Source Directory: d:\thunderstonesoftware\webinator/texis/Remodeler/dbtest/*
Destination Directory: d:\thunderstonesoftware\webinator/texis/Remodeler/db2
Flipping Switch...
Profile: Wholesaler
Active Directory: d:\thunderstonesoftware\webinator/texis/Wholesaler/db2
Source Directory: d:\thunderstonesoftware\webinator/texis/Wholesaler/dbtest/*
Destination Directory: d:\thunderstonesoftware\webinator/texis/Wholesaler/db1
Flipping Switch...
Profile: MechanicalEngineer
Active Directory: d:\thunderstonesoftware\webinator/texis/MechanicalEngineer/db1
Source Directory: d:\thunderstonesoftware\webinator/texis/MechanicalEngineer/dbtest/*
Destination Directory: d:\thunderstonesoftware\webinator/texis/MechanicalEngineer/db2
Flipping Switch...
<H6 ALIGN=right><A HREF="http://www.thunderstone.com/" TARGET="_top"><IMG SRC="/copy.gif" BORDER=0 WIDTH=304 HEIGHT=11 ALIGN=top ALT="Texis & Webinator Copyright (c) 2003 THUNDERSTONE - EPI, Inc."></A></H6>
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

MoveAndGoLive - File copy/activation not working

Post by mark »

That output is not from that script. There are messages in the script that would have to come out for success or failure that are not present in your output. Make sure you're running the right script.
jamon
Posts: 163
Joined: Wed Jun 26, 2002 9:35 am

MoveAndGoLive - File copy/activation not working

Post by jamon »

Good catch!!!!

That's very strange. I opened the MoveAndGoLive script, and added a timestamp to be displayed, so that I'd be sure I was running the version I thought I was running. Then, I saved and closed the file and ran it again.

It worked.

The only thing I can think is that the .vtx file was different (not a product of this script), and somehow it did not get re-compiled when I ran it. How does texis know when to recompile? Timestamp only? That could be what happened. The script I sent was the only one in that directory.

Here's the output from the rerun. It includes the timestamp I added, which probably caused the recompile that was needed.


D:\ThunderstoneSoftware\Moen\Scripts>REM ===============================================

D:\ThunderstoneSoftware\Moen\Scripts>REM File: MoveAndGoLive.bat

D:\ThunderstoneSoftware\Moen\Scripts>REM Purpose: Copy New files from dbtest to

D:\ThunderstoneSoftware\Moen\Scripts>REM db2 or db1, and flip the active

D:\ThunderstoneSoftware\Moen\Scripts>REM db to the one just copied.

D:\ThunderstoneSoftware\Moen\Scripts>REM TIMESTAMP: 29-AUG-2003

D:\ThunderstoneSoftware\Moen\Scripts>REM ===============================================

D:\ThunderstoneSoftware\Moen\Scripts>REM d:\wwwmoencom\cgi-bin\texis.exe -r -e MoveAndGoLive_errors.log "d:\thunderstonesoftware\moen\scripts\MoveAndGoLive"

D:\ThunderstoneSoftware\Moen\Scripts>d:\Thunderstonesoftware\webinator\texis.exe -r -e MoveAndGoLive_errors.log "d:\thunderstonesoftware\moen\scripts\MoveAndGoLive"

<!-- Texis RDBMS Copyright (c) 1992 - 2003 Thunderstone - EPI, Inc. -->
<!-- Texis Web Script Copyright (c) 1996 - 2003 Thunderstone - EPI, Inc. -->


Script Version: 29-Aug-2003 (timestamp to verify version being run)

Profile: Consumer
Active Directory: d:\ThunderstoneSoftware\Webinator/texis/Consumer/db1
Source Directory: d:\ThunderstoneSoftware\Webinator/texis/Consumer/dbtemp/*
Destination Directory: d:\ThunderstoneSoftware\Webinator/texis/Consumer/db2
Destination Dataspace: d:\ThunderstoneSoftware\Webinator/texis/Consumer
Flipping Switch...
Directory String: d:\ThunderstoneSoftware\Webinator/texis/Consumer/db2
Done: Switched the Consumer profile to
Dataspace String: d:\ThunderstoneSoftware\Webinator/texis/Consumer
Done: Switched the Consumer dataspace to
=========================
Profile: Builder
Active Directory: d:\thunderstonesoftware\webinator/texis/Builder/db2
Source Directory: d:\thunderstonesoftware\webinator/texis/Builder/dbtemp/*
Destination Directory: d:\thunderstonesoftware\webinator/texis/Builder/db1
Destination Dataspace: d:\thunderstonesoftware\webinator/texis/Builder
Flipping Switch...
Directory String: d:\thunderstonesoftware\webinator/texis/Builder/db1
Done: Switched the Builder profile to
Dataspace String: d:\thunderstonesoftware\webinator/texis/Builder
Done: Switched the Builder dataspace to
=========================
Profile: Designer
Active Directory: d:\thunderstonesoftware\webinator/texis/Designer/db1
Source Directory: d:\thunderstonesoftware\webinator/texis/Designer/dbtemp/*
Destination Directory: d:\thunderstonesoftware\webinator/texis/Designer/db2
Destination Dataspace: d:\thunderstonesoftware\webinator/texis/Designer
Flipping Switch...
Directory String: d:\thunderstonesoftware\webinator/texis/Designer/db2
Done: Switched the Designer profile to
Dataspace String: d:\thunderstonesoftware\webinator/texis/Designer
Done: Switched the Designer dataspace to
=========================
Profile: Plumber
Active Directory: d:\thunderstonesoftware\webinator/texis/Plumber/db1
Source Directory: d:\thunderstonesoftware\webinator/texis/Plumber/dbtemp/*
Destination Directory: d:\thunderstonesoftware\webinator/texis/Plumber/db2
Destination Dataspace: d:\thunderstonesoftware\webinator/texis/Plumber
Flipping Switch...
Directory String: d:\thunderstonesoftware\webinator/texis/Plumber/db2
Done: Switched the Plumber profile to
Dataspace String: d:\thunderstonesoftware\webinator/texis/Plumber
Done: Switched the Plumber dataspace to
=========================
Profile: Retailer
Active Directory: d:\thunderstonesoftware\webinator/texis/Retailer/db2
Source Directory: d:\thunderstonesoftware\webinator/texis/Retailer/dbtemp/*
Destination Directory: d:\thunderstonesoftware\webinator/texis/Retailer/db1
Destination Dataspace: d:\thunderstonesoftware\webinator/texis/Retailer
Flipping Switch...
Directory String: d:\thunderstonesoftware\webinator/texis/Retailer/db1
Done: Switched the Retailer profile to
Dataspace String: d:\thunderstonesoftware\webinator/texis/Retailer
Done: Switched the Retailer dataspace to
=========================
Profile: Remodeler
Active Directory: d:\thunderstonesoftware\webinator/texis/Remodeler/db1
Source Directory: d:\thunderstonesoftware\webinator/texis/Remodeler/dbtemp/*
Destination Directory: d:\thunderstonesoftware\webinator/texis/Remodeler/db2
Destination Dataspace: d:\thunderstonesoftware\webinator/texis/Remodeler
Flipping Switch...
Directory String: d:\thunderstonesoftware\webinator/texis/Remodeler/db2
Done: Switched the Remodeler profile to
Dataspace String: d:\thunderstonesoftware\webinator/texis/Remodeler
Done: Switched the Remodeler dataspace to
=========================
Profile: Wholesaler
Active Directory: d:\thunderstonesoftware\webinator/texis/Wholesaler/db2
Source Directory: d:\thunderstonesoftware\webinator/texis/Wholesaler/dbtemp/*
Destination Directory: d:\thunderstonesoftware\webinator/texis/Wholesaler/db1
Destination Dataspace: d:\thunderstonesoftware\webinator/texis/Wholesaler
Flipping Switch...
Directory String: d:\thunderstonesoftware\webinator/texis/Wholesaler/db1
Done: Switched the Wholesaler profile to
Dataspace String: d:\thunderstonesoftware\webinator/texis/Wholesaler
Done: Switched the Wholesaler dataspace to
=========================
Profile: MechanicalEngineer
Active Directory: d:\thunderstonesoftware\webinator/texis/MechanicalEngineer/db1
Source Directory: d:\thunderstonesoftware\webinator/texis/MechanicalEngineer/dbtemp/*
Destination Directory: d:\thunderstonesoftware\webinator/texis/MechanicalEngineer/db2
Destination Dataspace: d:\thunderstonesoftware\webinator/texis/MechanicalEngineer
Flipping Switch...
Directory String: d:\thunderstonesoftware\webinator/texis/MechanicalEngineer/db2
Done: Switched the MechanicalEngineer profile to
Dataspace String: d:\thunderstonesoftware\webinator/texis/MechanicalEngineer
Done: Switched the MechanicalEngineer dataspace to
=========================
<H6 ALIGN=right><A HREF="http://www.thunderstone.com/" TARGET="_top"><IMG SRC="/copy.gif" BORDER=0 WIDTH=304 HEIGHT=11 ALIGN=top ALT="Texis & Webinator Copyright (c) 2003 THUNDERSTONE - EPI, Inc."></A></H6>
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

MoveAndGoLive - File copy/activation not working

Post by mark »

Yes, the file timestamp is used to determine if the source file is newer than the .vtx and should be recompiled. If modules are used in the script it's slightly more complicated.
Post Reply