Created
September 2, 2011 14:50
-
-
Save kingbin/1188808 to your computer and use it in GitHub Desktop.
windows quick script, backup contents of folder and retain for 30 days.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xcopy "c:\DIR_TO_BKUP\*.*" c:\Backup\*.* /e /h /r /y | |
7za a -tzip ourdatafile.zip "c:\Backup" | |
rename ourdatafile.zip ourdatafile.%Date:~-4,4%%Date:~-10,2%%Date:~-7,2%.zip | |
move ourdatafile.%Date:~-4,4%%Date:~-10,2%%Date:~-7,2%.zip "c:\ProgramData\bkups" | |
forfiles -p "c:\ProgramData\bkups" -s -m *.* -d 30 -c "cmd /c del @path" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment