I set-up a quick backup system that archives a week of SCCM backups. If you have not configured your backup you will need to go to ConfigMgr Console > Administration > Site Configuration > Sites > Site Name > Site Maintenance.
Once your backup task is set-up and working, you can then create the AfterBackup.bat which automatically runs as part of the backup maintenance task. I used these instructions to make the archived backups with the name of the day it was created.
REM @echo off setlocal enabledelayedexpansion set target=\\SCCM01\ConfigMgr$\Backup\Archive\%date:~0,3% If not exist %target% goto datacopy RD %target% /s /q :datacopy xcopy "\\SCCM01\ConfigMgr$\Backup\WCMBackup\*" "%target%\" /E /-Y
I did a test with this and all worked perfectly. I now have a week of backups.