|
Answer» I'm using the following batch with Scheduled Tasks in XP to do a daily backup for a complete folder, now I want to copy only certain files in that folder... does any ONE know how I can do this?
Code: [Select]SET dd=%DATE:~0,2% SET mm=%DATE:~3,2% SET yyyy=%DATE:~6,4% SET hh=%TIME:~0,2% SET mn=%TIME:~3,2% SET SS=%TIME:~6,2% xcopy C:\data D:\backup\%dd%-%mm%-%yyyy%-%hh%%mn%%ss%\ /Y /EWHAT certain files, all the .txt files or what?change the line: Code: [Select]xcopy C:\data D:\backup\%dd%-%mm%-%yyyy%-%hh%%mn%%ss%\ /Y /E
to reflect the file masks you which to copy, for example:
Code: [Select]xcopy C:\data D:\backup\%dd%-%mm%-%yyyy%-%hh%%mn%%ss%\*.txt /Y /E
If you only want to copy very specifically named files, you'll need to do this: Code: [Select]set filescopy=file1.txt file2.bmp anotherfile.jpg for %%P in (filescopy) do xcopy C:\data D:\backup\%dd%-%mm%-%yyyy%-%hh%%mn%%ss%\%%P /Y /E
And then change the set= line to reflect those specific files you wish to copy. you could include file masks, as well, such as *.txt and *.LOG or something to that effect.
|