News and backup: Difference between revisions

From CCMDB Wiki
Jump to navigation Jump to search
TOstryzniuk (talk | contribs)
TOstryzniuk (talk | contribs)
Line 58: Line 58:


== When do Data Collectors Run this?==
== When do Data Collectors Run this?==
The shortcut is on your desktop.  It must be run before you start your shift to ensure you have the latest CCMDB (Access program).  It should be run when you have entered alot of data before you end your shift.    You should also run it BEFORE you delete any files sent from you laptop.  Main office has the opportunity to get stuff from these backups if there is a problem. Example of this is June 7.13 when new program was rolled out, postal code and color for overstay in TMP was being sent to TMPV2.mdb as "chinese  type" letters.  Main office was able to retrieve from regional server for site that backed up their data.[[User:TOstryzniuk|Trish Ostryzniuk]] 17:00, 2013 June 10 (EDT)
The shortcut is on your desktop.  It must be run before you start your shift to ensure you have the latest CCMDB (Access program).  It should be run when you have entered alot of data before you end your shift.    You should also run it BEFORE you delete any files sent from your laptop.  Main office has the opportunity to get stuff from these backups if there is a problem. Example of this is June 7.13 when new program was rolled out, postal code and color for overstay in TMP was being sent to TMPV2.mdb as "chinese  type" letters.  Main office was able to retrieve from regional server for site that backed up their data.[[User:TOstryzniuk|Trish Ostryzniuk]] 17:00, 2013 June 10 (EDT)


[[Category: Batch Files]]
[[Category: Batch Files]]
[[Category: Data Backup Dependencies]]
[[Category: Data Backup Dependencies]]

Revision as of 16:39, 2013 June 10

The "News and Backup" batch file is a batch file on each laptop used to back up data.

Backup using the file

To back up, double-click on the "News and Backup" shortcut on your desktop.

Off line mode

When not hooked up to the network the batch file will backup data to the SD Card

On-line mode

When hooked up to the network, the batch file will perform the off-line work, but also back-up the data to the regional server and copy down a new version of CCMDB.mdb if available.

Operation of the file

For the most up-to-date workings of this file see the file itself and the change log News and Backup Change Log

The "News and Backup" batch file is a batch file on each laptop which does the following:

  • checks if there is a newer version of itself (technically it's the caller batch file that does this...)
  • back up c:\ccmdb_data\ccmdb_data.mdb to the SD card
  • back up to server w 20 versions
    • delete Regional Server\Programs\<hosp>_<ward>\ccmdb.20
    • rename ccmdb.19 to ccmdb.20, ccmdb18 to ccmdb.19, ... ccmdb.1 to ccmdb.2, ccmdb.mdb to ccmdb.1
    • copy c:\ccmdb_data\ccmdb_data.mdb to Regional Server\data\<hosp>_<ward>
  • check if there is a file Regional Server\Programs\<hosp>_<ward>\ccmdb.mdb; if so,
    • move the file from the regional server to c:\ccmdb_program
    • open the wiki to Log to show what has changed

Setting up the file on a laptop

If the laptop is set up according to Laptop Setup then the batch files and shortcuts will be copied down as part of the process. The only thing to do locally would be to edit parameters for location.

Master file location

If not already done during Laptop Setup, copy from master file location

Edit parameters for location

To edit a batch file, right-click and edit the file. Don't double-click because that would RUN the file

batstart.bat contains lines that serve as parameters for the file to work in different locations. For the most part, all possible entries are present in the file, with the ones not applicable for a location "commented out". To comment out a line, put a ":" (without the quotes) in front of the line you don't want to run.

  • edit parameters - only the "Location Specific Parameters" section of c:\batches\batstart.bat

if the shortcut is missing...

see All shortcuts fixer.bat

Testing News and Backup

After initial setup test that the backup works:

  • make some change in ccmdb.mdb to update date stamp of file on the client laptop
  • execute the News and Backup batch file to perform the process
  • check that ccmdb.mdb file with new stamp is on sd card
  • check that ccmdb.mdb file with new stamp is on Regional Server/data/<hsp>_<ward>

Information about the batch files

A two-file system is used to allow batstart.bat to actually look for a new backup.bat on regional server\programs\<location> before each run, allowing a central update of that file if necessary. This allows for centralized updating/tweaking/etc of the laptops.

Batstart.bat uses Robocopy, sort of an improved version of xcopy, which is available from Microsoft as part of one of their Server SDKs.

Updating the file

I will need to test that the update still works since we had to cheat the system to get the new regional server hooked in. Ttenbergen 18:23, 2013 March 21 (EDT)

BatStart.bat looks on an update to backup.bat in regional server\programs\<location>; that file will replace the local one. Template:Discussion Is this fixed now?-Trish Ostryzniuk 16:55, 2013 June 10 (EDT)

When do Data Collectors Run this?

The shortcut is on your desktop. It must be run before you start your shift to ensure you have the latest CCMDB (Access program). It should be run when you have entered alot of data before you end your shift. You should also run it BEFORE you delete any files sent from your laptop. Main office has the opportunity to get stuff from these backups if there is a problem. Example of this is June 7.13 when new program was rolled out, postal code and color for overstay in TMP was being sent to TMPV2.mdb as "chinese type" letters. Main office was able to retrieve from regional server for site that backed up their data.Trish Ostryzniuk 17:00, 2013 June 10 (EDT)