Edit and fill out the needed values.
You can set a local or remote UNC backup path and the scheduling options. Whatever you decide you can use the AfterBackup.bat to move or archive it afterwards.
The computer account of the ConfigMgr server has to have been granted full control permissions on the remote backup location.
Creating the AfterBackup.bat file Here is a simple script for 'AfterBackup.bat' written by 'Garth Jones', which saves 7 days backup to a folder named after the first 3 letters of the day of the week, and also deletes/overwrites the older ones. *********************************************************************************** REM @echo off setlocal enabledelayedexpansion set target=\\Destination_Server\E$\AfterBackup\%date:~0,3% If not exist %target% goto datacopy RD %target% /s /q :datacopy xcopy "\\Source_Server\*" "%target%\" /E /-Y *********************************************************************************** where, "Source_Server" is the Primary Server from which the backup has to be copied, and "Destination_Server" is the Remote Server where you want to copy the Site Backup.Source_Server (This is the UNC path specified in ConfigMgr)
\\SCCM2012\sccm$\_Backup
Destination_Server (This is where we store the backup)
\\FILE01\SCCM$\SCCM_Backup
Although the intended use of AfterBackup.bat is to archive SCCM backup snapshots, you can use that file for other tasks that you need to perform at the end of every back up operation, such as:- Run a SQL Server DBCC test to verify that there are no integrity problems with the SCCM Site database.
- Run a site health tool, or other health tools.
ConfigMgr overwrites each backup when it runs the site backup task. You must use the AfterBackup.bat or manual copy to archive more than one backup.
Starting a backup outside of the schedule You can start a backup at any time by going into the service manager which can be launched through the console. Monitoring tab > System Status > Component State > Ribbon > Start > Configuration Manager Service Manager Once in service manager, locate the SMS_SITE_BACKUP service and right click start. A backup will now start. Another option is to go to Windows Services.msc and start the SMS_SITE_BACKUP service. After a successful backup you will see this in your logs: And the backup is copied over to your alternate backup location!
No comments:
Post a Comment