Difference between revisions of "Scheduling Backup"
From IMSMA Wiki
Line 1: | Line 1: | ||
{{Under construction| }} | {{Under construction| }} | ||
+ | {{Warning | This script '''only''' takes backup of the database and the attachments.}} | ||
+ | |||
+ | <ol> | ||
+ | <li> | ||
Modify the following script: | Modify the following script: | ||
<pre> | <pre> | ||
Line 15: | Line 19: | ||
</pre> | </pre> | ||
− | Save it with name runIMSMAbackup.bat. Do | + | <li>Save it with name ''runIMSMAbackup.bat''. Do '''not''' save it in the ''C:\IMSMAng'' folder. |
− | Schedule a task in the Operating System's Task scheduler. The following steps are done with Windows 7, follow those steps: | + | <li>Schedule a task in the Operating System's Task scheduler. The following steps are done with Windows 7, follow those steps: |
− | + | ||
<li>Go to Control Panel → Administrative Tools → Task Scheduler</li> | <li>Go to Control Panel → Administrative Tools → Task Scheduler</li> | ||
[[Image:Windows Scheduler.png|center|600px]] | [[Image:Windows Scheduler.png|center|600px]] | ||
Line 25: | Line 29: | ||
<li>Next, refine recurrence criteria (e.g. time of the day) and click '''Next'''.</li> | <li>Next, refine recurrence criteria (e.g. time of the day) and click '''Next'''.</li> | ||
<li>In the next window, select '''Start a Program''' and click '''Next'''.</li> | <li>In the next window, select '''Start a Program''' and click '''Next'''.</li> | ||
− | <li>Browser to the previously created script, e.g. C:\runIMSMAbackup.bat Click '''Next''' and then '''Finish'''.</li> | + | <li>Browser to the previously created script, e.g. C:\backups\runIMSMAbackup.bat Click '''Next''' and then '''Finish'''.</li> |
</ol> | </ol> | ||
Revision as of 16:07, 2 August 2016
This script only takes backup of the database and the attachments. |
-
Modify the following script:
@echo off @echo Backing up database. This may take awhile, do not close this window. :: C:\xyz being the location you desire. You must have read/write access to it. It has to be replaced at FOUR positions in this script. c:\imsmang\pgsql\bin\pg_dump -U imsma > C:\xyz\dump.sql @echo Creating folder :: Creates a folder with the date as a timestamp, similar to the backups done in IMSMA. Then moves the dump.sql to it. set foldername=Backup_%date:~10,4%_%date:~4,2%_%date:~7,2%_%time:~0,2%_%time:~3,2%_%time:~6,2% mkdir c:\xyz\%foldername% move c:\xyz\dump.sql c:\AnneLifiler\%foldername%\ cmd /c echo F | xcopy C:\IMSMAng\server\attachments c:\xyz\%foldername%\server\attachments /c /e /i /h /q @echo Done.
- Save it with name runIMSMAbackup.bat. Do not save it in the C:\IMSMAng folder.
- Schedule a task in the Operating System's Task scheduler. The following steps are done with Windows 7, follow those steps:
- Go to Control Panel → Administrative Tools → Task Scheduler
- In the Task Scheduler interface, click on Create Basic Task...
- In the Create Basic Task Wizard, provide a name, e.g. IMSMA Backup and an optional description. Click Next.
- In the next window, specify the required recurrence (daily, weekly, etc.) and click Next.
- Next, refine recurrence criteria (e.g. time of the day) and click Next.
- In the next window, select Start a Program and click Next.
- Browser to the previously created script, e.g. C:\backups\runIMSMAbackup.bat Click Next and then Finish.
The IMSMANG backup should now start at the specified time.
It is advised to plan when to take the backup carefully, i.e. it is best during the night when no one is accessing and entering data into IMSMANG, as this might lead to inconsistencies.Template:NavBox How To Backup