News and backup: Difference between revisions

From CCMDB Wiki
Jump to navigation Jump to search
m u
Line 1: Line 1:
The "'''News and Backup'''" batch file is a batch file on each '''laptop''' used to back up data.
This article is about the "'''News and Backup'''" process collectors use to back up data from their '''laptop'''.


== Backup using the file ==
== Backing up ==
'''To back up, double-click on the "News and Backup" shortcut on your desktop.'''
'''To back up, double-click on the "News and Backup" shortcut on your desktop.'''
=== When do Data Collectors Run NEWS and BACKUP?===
=== When do Data Collectors Run NEWS and BACKUP?===
'''VERY IMPORTANT!'''  There are have a number of staff who continue not following the process for news and backups outlined below. I am reminding all staff that this is mandatory and I am monitoring it.  There is no reason that I should be seeing a backup only once per week at sending date only unless on vacation or sick.  There are a number of projects going on and also database redevelopment which requires the cooperation of ALL staff.  Main office should not be getting after staff to do their REQUIRED backups!  Thank you for your attention to this. If this lack of cooperation continues, then changes will be made to reduce any "flexibility" on this process. [[User:TOstryzniuk|Trish Ostryzniuk]] 15:49, 2013 December 3 (CST)   
* Run '''while connected to the network''' at at the following times ('''required''' - this goes to Regional Server):  
* Run '''while connected to the network''' at at the following times ('''required''' - this goes to Regional Server):  
#at '''every shift start''' before data entry (to ensure you have the newest version of the program)
**at '''every shift start''' before data entry (to ensure you have the newest version of the program)
#at '''every shift end''' (to ensure your data is backed up to the server)
**at '''every shift end''' (to ensure your data is backed up to the server)
#'''before deleting''' any files sent from your laptop to regional server 
**'''before deleting''' any files after [[sending]]
#*when disconnected from the network you can run it as often as you want; this creates additional intermediate backups only on your SD card however this '''does not preclude the above required backups to Regional Server.'''
* when disconnected from the network you can run it as often as you want; this creates additional intermediate backups only on your SD card however this '''does not preclude the above required backups to Regional Server.'''


==Importance of backup to REGIONAL SERVER==
==Importance of backup to REGIONAL SERVER==
Line 15: Line 14:
*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 characters being sent to TmpV2 | "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)
*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 characters being sent to TmpV2 | "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)
*another example of this: Nov.13 - discovered that ICU Pharmacy items YES NO not going into pharmacy.mdb or centralized.mdb from first week of June to Aug 13.13.  Because of backups to Regional Server, the Main office had the opportunity to pull together copies of  these backups and retrieve the "lost pharm data".  This has saved the data collector from having to recollect pharmacy data from the chart.[[User:TOstryzniuk|Trish Ostryzniuk]] 15:49, 2013 December 3 (CST)
*another example of this: Nov.13 - discovered that ICU Pharmacy items YES NO not going into pharmacy.mdb or centralized.mdb from first week of June to Aug 13.13.  Because of backups to Regional Server, the Main office had the opportunity to pull together copies of  these backups and retrieve the "lost pharm data".  This has saved the data collector from having to recollect pharmacy data from the chart.[[User:TOstryzniuk|Trish Ostryzniuk]] 15:49, 2013 December 3 (CST)
=== 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 ==
== Operation of the file ==
Line 39: Line 33:


=== Master file location ===
=== Master file location ===
If not already done during [[Laptop Setup]], copy from master file location
* [[Regional Server]]\maintenance\laptop batches\  
* [[Regional Server]]\maintenance\laptop batches\* --> c:\batches
** [[Batstart.bat]]
** [[Backup.bat]]


=== Edit parameters for location ===
=== Edit parameters for location ===
Line 62: Line 57:


== Information about the batch files ==
== 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.  
A two-file system is used to allow [[batstart.bat]] to actually look for a '''new''' [[backup.bat]] 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.
[[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 ==
== Updating the file ==
Line 71: Line 66:
Make sure [[Batstart.bat#Log]]/[[Backup.bat#Log]] is updated with any changes.  
Make sure [[Batstart.bat#Log]]/[[Backup.bat#Log]] is updated with any changes.  


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)
== Error checking ==
{{Discussion}}
Just do your backups and assume they work, there is no need for collectors to routinely check that the backups to the regional server are working. Main office checks regularly that backups are being done, so if backups are not making it to the regional server we will let you know.  
* Is this fixed now?-[[User:TOstryzniuk|Trish Ostryzniuk]] 16:55, 2013 June 10 (EDT)
 
** I am confirming that as I visit laptops. Oaks, Grace and Vic for sure use the new file now. This will make no difference unless I need to roll out a change to news and backup, which is rare. Because I am aware of that, it is OK to fix these as we come across them. Ttenbergen 11:06, 2013 June 12 (EDT)
Main office uses [[Backup_Checker.vbs]] to make sure the backups are working.  
*** still confirming further locations... Ttenbergen 15:02, 2013 June 24 (EDT)


==Error checking==
== problems ==
{{Discussion}}
* How does the Data Collector know if running News & Backup has successfully backed up the data on the Regional Server?  We have been told that our backup has not worked since April, but no blatant error messages have occurred at any time to indicate a problem.  We even have new laptops that were installed mid May, yet no backups are on the server.
**  There is no built-in error checking. Generally these files either work or they don't. What has gone wrong with the backups in the problem locations is that we set up new laptops and missed a step. I will change the file so that the thing we missed will raise an error if we miss it again. Will update here when done.  Ttenbergen 11:09, 2013 June 12 (EDT)
***to prevent any similar issues in the future would it be an idea for someone at your end to doublecheck each week/month or whatever time frame is reasonable to use, to make sure some data has in fact been backed up from each site/laptop on the Regional Server?
****There is a program in ADMIN folder on the Regional Server called: [[Backup_Checker.vbs]].  Anyone can run it and see when the last backup was done for each Hosp_location. 
{{discussion}}
*July 16.13 - [[Change Priorities]] Dawna, Gra MICU, is having trouble with the news & backup for the ICU laptop.  The error message that comes up each time is that a duplicate file name exists or the file cannot be found.  I believe she emailed a screenshot of the message to you yesterday but it is still happening.  After the error message repeats multiple times, it claims to be starting the backup to the SD card but then it stalls and goes no further.  Is there a quick fix for this? Thanks-stephanie Cortilet.  
*July 16.13 - [[Change Priorities]] Dawna, Gra MICU, is having trouble with the news & backup for the ICU laptop.  The error message that comes up each time is that a duplicate file name exists or the file cannot be found.  I believe she emailed a screenshot of the message to you yesterday but it is still happening.  After the error message repeats multiple times, it claims to be starting the backup to the SD card but then it stalls and goes no further.  Is there a quick fix for this? Thanks-stephanie Cortilet.  
** is that still a problem? Ttenbergen 10:44, 2014 April 24 (CDT)
** is that still a problem? Ttenbergen 10:44, 2014 April 24 (CDT)
*** Grace laptops are coming to collector meeting this week, should be fixed there. Ttenbergen 13:58, 2014 September 29 (CDT)


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

Revision as of 12:58, 2014 September 29

This article is about the "News and Backup" process collectors use to back up data from their laptop.

Backing up

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

When do Data Collectors Run NEWS and BACKUP?

  • Run while connected to the network at at the following times (required - this goes to Regional Server):
    • at every shift start before data entry (to ensure you have the newest version of the program)
    • at every shift end (to ensure your data is backed up to the server)
    • before deleting any files after sending
  • when disconnected from the network you can run it as often as you want; this creates additional intermediate backups only on your SD card however this does not preclude the above required backups to Regional Server.

Importance of backup to REGIONAL SERVER

The Main office has the opportunity to get data 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)
  • another example of this: Nov.13 - discovered that ICU Pharmacy items YES NO not going into pharmacy.mdb or centralized.mdb from first week of June to Aug 13.13. Because of backups to Regional Server, the Main office had the opportunity to pull together copies of these backups and retrieve the "lost pharm data". This has saved the data collector from having to recollect pharmacy data from the chart.Trish Ostryzniuk 15:49, 2013 December 3 (CST)

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

Edit parameters for location

  1. right-click the news-and-backup shortcut and click "edit"
    • Don't double-click because that would run the file
  2. go to the line that starts with "set ml=", should be around line 9
  3. change the part after the = to your directory on the regional server, e.g. HSC_H4
    • don't add spaces
    • make sure it's the directory used for the location, for legacy reasons this might not be the main ward now collected on
  4. menu file save, menu file close

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 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

BatStart.bat looks on an update to backup.bat in regional server\programs\<location>; that file will replace the local one.

Make sure Batstart.bat#Log/Backup.bat#Log is updated with any changes.

Error checking

Just do your backups and assume they work, there is no need for collectors to routinely check that the backups to the regional server are working. Main office checks regularly that backups are being done, so if backups are not making it to the regional server we will let you know.

Main office uses Backup_Checker.vbs to make sure the backups are working.

problems

  • July 16.13 - Change Priorities Dawna, Gra MICU, is having trouble with the news & backup for the ICU laptop. The error message that comes up each time is that a duplicate file name exists or the file cannot be found. I believe she emailed a screenshot of the message to you yesterday but it is still happening. After the error message repeats multiple times, it claims to be starting the backup to the SD card but then it stalls and goes no further. Is there a quick fix for this? Thanks-stephanie Cortilet.
    • is that still a problem? Ttenbergen 10:44, 2014 April 24 (CDT)
      • Grace laptops are coming to collector meeting this week, should be fixed there. Ttenbergen 13:58, 2014 September 29 (CDT)