Setup Nightly Compress and Backup

Revised:  4/2021

 

You may ask yourself “What is the proper procedure of nightly compression of the database for the web? “ We suggest restarting IIS and at the same time compress and backup your database. You can do this by simply adding a batch file to Task Manager or Windows Server to run every night.

We have created a sample batch file for you to use, that stops and starts IIS, compresses the database and runs a backup. 

The database and custom reports will be zipped into a file in the finance directory using a different name every time the procedure is run. You can modify this batch file to meet your needs and change the directory where the batch is looking.

Please NOTE that when running this, it will SHUT EVERYONE DOWN. Keep in mind that this is a supplemental backup to your regular network backup.

1.   Download the batch file from ftp://ftp.schooloffice.com (copy and paste in your browser.)

2.   Enter user name = ftpguest password = sds

3.   Navigate to FromSds\Batch

4.   Save Compback.bat to your finance directory.

5.   Open Compback.bat and modify it to match your directory structure. 

Below/next page is an example of what is in it. Rem are remarks for guidance and the bold lines is what will run. The line FinanceMdb%Random% will create a file named FinanceMDB with a random number after it, this way if you run the process more than once in a day you will not overwrite your previous zip.

Rem ***********************************************************************************************************
Rem ***Rember this is intended as a supplemental backup. You MUST do a regular system backup.***
Rem ***********************************************************************************************************
rem After IISRESET add server name This will force IIS to release the database
IISRESET
rem
Rem ***********************************************************************************************************
Rem Change to mapped drive
F:
rem
Rem ***********************************************************************************************************
rem change to working directory
cd \sdsv8\finance
rem
Rem ***********************************************************************************************************
rem run the compress process
u22_uday.exe COMPRESS
rem
Rem ***********************************************************************************************************
rem zip the database to a file named FinanceMdb%RANDOM%
rem the %RANDOM% will add a random number to the file name to minimize the possibility of recreating the same file name each day.
rem file will contain finance database, control database, and customized reports
rem The file will reside in the finance directory or you could add a drive and path before the file name FinanceMdb%RANDOM%
rem
pkzipc -add FinanceMdb%RANDOM% F:sdsx*.mdb F:sdsc*.mdb F:???c*.rpt
rem
Rem ***********************************************************************************************************
rem In task manager enter the following in the appropriate files to launch this as a batch file named CompBack.bat
rem Check the Active Column
rem Enter the Hour you wish to start the batch file
rem Enter the Minute you wish to start the batch file
rem Enter the batch file name and its fully qualified path. F:\SDSV8\FINANCE\CompBack.bat
Rem ***********************************************************************************************************
Rem ***Rember this is intended as a supplemental backup. You MUST do a regular system backup.***
Rem ***********************************************************************************************************

6.   Once you have modified the batch file then enter the Web Control Center/V8.5.

7.   Click on Utilities |Task Manager

See screen shot example below before proceeding to get a visual.

8.   Double click on the last record of the Task Processing List and a new line will appear.

9.   Enter in the hour (i.e. 03) and minutes (i.e. 00) of when you would like the batch to run. If you are a small school/district we suggest you run this in the middle of the night or early in the morning when no one is working. If you are a larger district we suggest you run this more than once a day for example at lunch and then late in the evening or early morning. Keep in mind when you run this everyone will be shut out of SDS. (You can also lock users out in Web Financial Office.)

10. Enter in a Description for the task (i.e. Stop IIS, Compress, Zip).

11. Enter in the Task Location and File Name for example F:\sdsv8\finance\CompBack.bat

12. Place a check mark in the box so the task is Active.

Keep U22_TASK.exe running at night/during the day so that the task will run. If U22_TASK.exe is not running the task will not run. Leave task manager running on a computer that is never turned off.

We recommend adjusting the task manager so that there is another line with a task that Restarts the Task Manager for the next day.

For Example: Hour=03, Minute=30, Description=Start Task Manager, Task File Name F:\sdsv8\finance\u22_task.exe

13. Go to File| Save active Task List

14. Click Activate (Add remember to keep this program running or the tasks will not run.)

 



Note: if you do not want the zip file to use %RANDOM% where it will assign the file a random number you can change it to today’s date. We CAUTION you in doing this, because if you run this procedure more than once a day you WILL overwrite your backup that was created earlier in the day. To do this, modify the batch file to use FinanceMDB%1 and when setting up the Task Manager in the very final column Activation Information (program options) type in Date. Then the zip will have the date after the name.

If you do not want to use U22_TASK.exe you can still use the batch file, but have Windows Server launch it.