need a script to split inputs to a-m and n-z for robocopy
Moderator: DosItHelp
-
- Posts: 13
- Joined: 20 Nov 2012 16:04
Re: need a script to split inputs to a-m and n-z for robocop
ugh.
go figure, now i get:
The input line is too long.
ok... time to think why it doesn't like 384 directories to exclude. besides the fact its a ton of folders... any ideas?
go figure, now i get:
The input line is too long.
ok... time to think why it doesn't like 384 directories to exclude. besides the fact its a ton of folders... any ideas?
Re: need a script to split inputs to a-m and n-z for robocop
The command line has a length limit. 2 KB in W2k and 8 KB in XP.
Robocopy may have it's own length limit, if that is what you were using.
I think Robocopy can use a configuration file with the exclusions in it, to get over the line length.
Robocopy may have it's own length limit, if that is what you were using.
I think Robocopy can use a configuration file with the exclusions in it, to get over the line length.
Re: need a script to split inputs to a-m and n-z for robocop
Are you creating a mirror backup, or just backing up files and leaving what is already there?
If so then xcopy might be an option and it can also exclude things using a configuration file.
If so then xcopy might be an option and it can also exclude things using a configuration file.
-
- Posts: 13
- Joined: 20 Nov 2012 16:04
Re: need a script to split inputs to a-m and n-z for robocop
yes, i am using robocopy with the /mir switch.... so mirroring and not just doing a backup.
ok, in regards to a config file... that brings it back to what i've already had to some degree.
just thinking out loud here....
---------------
if we run a script pre-robocopy to create a csv file of the folders that NEED to be copied.
then use that csv to "make" those directories in the target drive.
then use each folder from the csv in the 'source' portion of robocopy and then also use it define the 'destination' folder, it might work.
---------------
ok, so what do you think about that approach? or have any other idea?
thanks,
m
ok, in regards to a config file... that brings it back to what i've already had to some degree.
just thinking out loud here....
---------------
if we run a script pre-robocopy to create a csv file of the folders that NEED to be copied.
then use that csv to "make" those directories in the target drive.
then use each folder from the csv in the 'source' portion of robocopy and then also use it define the 'destination' folder, it might work.
---------------
ok, so what do you think about that approach? or have any other idea?
thanks,
m
Re: need a script to split inputs to a-m and n-z for robocop
You had that solution here - no CSV files needed: viewtopic.php?p=22310#p22310
-
- Posts: 13
- Joined: 20 Nov 2012 16:04
Re: need a script to split inputs to a-m and n-z for robocop
errrr well now i feel dumb.
so, then going back to that solution... in order to not have to go thru 100's of summary files, is there a way to parse the end of the file to report or list all the summaries... kinda like the following all in a txt file:
so, then going back to that solution... in order to not have to go thru 100's of summary files, is there a way to parse the end of the file to report or list all the summaries... kinda like the following all in a txt file:
Code: Select all
Firstfolder summary:
------------------------------------------------------------------------------
Total Copied Skipped Mismatch FAILED Extras
Dirs : 52 0 52 0 0 0
Files : 0 0 0 0 0 0
Bytes : 0 0 0 0 0 0
Times : 0:00:00 0:00:00 0:00:00 0:00:00
Ended : Thu Nov 29 13:42:44 2012
Secondfolder summary:
------------------------------------------------------------------------------
Total Copied Skipped Mismatch FAILED Extras
Dirs : 52 0 52 0 0 0
Files : 0 0 0 0 0 0
Bytes : 0 0 0 0 0 0
Times : 0:00:00 0:00:00 0:00:00 0:00:00
Ended : Thu Nov 29 13:42:44 2012
.
.
.
Re: need a script to split inputs to a-m and n-z for robocop
This takes file.log and creates file2.log:
Code: Select all
@echo off
findstr /i /c:"summary:" /c:"Mismatch" /c:"Dirs :" /c:"Files :" /c:"Bytes :" /c:"Times : " /c:"Ended :" /c:"--------------" file.log >file2.log
-
- Posts: 13
- Joined: 20 Nov 2012 16:04
Re: need a script to split inputs to a-m and n-z for robocop
well, thats that then... i have what i need, thanks to you both.
the code as i'm using them is then as such:
spits out a summary log file looking like this:
it looks more organized in the actual log file which is converted to pdf then emailed to me for review.
the code as i'm using them is then as such:
Code: Select all
@echo off
DEL C:\robocopy\logs\ARCHIVE-am.LOG
pushd "E:\Case Archive"
for %%a in (a b c d e f j h i j k l m) do (
for /f "delims=" %%b in ( ' dir /ad /b "%%a*" ' ) do (
C:\robocopy\robocopy.exe "%%b" "I:\Archive Cases\%%b" /FFT /V /TEE /S /E /COPY:DT /PURGE /MIR /NP /R:0 /W:0 /xd *recycle* "*system volume*" ZZZZ* %unwanted% /xf thumbs.db *.nef /log+:C:\robocopy\logs\ARCHIVE-am.log /eta
)
)
popd
findstr /i /c:"source :" /c:"Mismatch" /c:"Dirs :" /c:"Files :" /c:"Bytes :" /c:"Times : " /c:"Ended :" /c:"-------------------------------------------------------------------------------" C:\robocopy\logs\ARCHIVE-am.LOG >C:\robocopy\logs\ARCHIVE-am-summary.LOG
spits out a summary log file looking like this:
Code: Select all
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
Source : E:\Case Archive\AbaXXXXXX v. YYYYY (ZZZ)\
Files : *.*
Exc Files : thumbs.db
Exc Dirs : *recycle*
Total Copied Skipped Mismatch FAILED Extras
Dirs : 13 0 13 0 0 0
Files : 43 0 43 0 0 0
Bytes : 86.93 m 0 86.93 m 0 0 0
Times : 0:00:00 0:00:00 0:00:00 0:00:00
Ended : Wed Dec 19 09:45:59 2012
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
Source : E:\Case Archive\AbeXXXXXX v. YYYYY (ZZZ)\
Files : *.*
Exc Files : thumbs.db
Exc Dirs : *recycle*
Total Copied Skipped Mismatch FAILED Extras
Dirs : 522 0 522 0 0 0
Files : 6759 0 6759 0 0 0
Bytes : 24.101 g 0 24.101 g 0 0 0
Times : 0:00:02 0:00:00 0:00:00 0:00:02
Ended : Wed Dec 19 09:46:02 2012
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
Source : E:\Case Archive\AdaXXX v. YYYYY (ZZZ)\
Files : *.*
Exc Files : thumbs.db
Exc Dirs : *recycle*
Total Copied Skipped Mismatch FAILED Extras
Dirs : 61 0 61 0 0 2
Files : 542 0 542 0 0 0
Bytes : 1.492 g 0 1.492 g 0 0 0
Times : 0:00:00 0:00:00 0:00:00 0:00:00
Ended : Wed Dec 19 09:46:02 2012
it looks more organized in the actual log file which is converted to pdf then emailed to me for review.
Last edited by redclawkefar on 19 Dec 2012 18:01, edited 2 times in total.
Re: need a script to split inputs to a-m and n-z for robocop
That's good to hear. Ta.
Just FYI if you use code tags around your pasted logs then they will retain the correct spaces and formatting.
Just FYI if you use code tags around your pasted logs then they will retain the correct spaces and formatting.
-
- Posts: 13
- Joined: 20 Nov 2012 16:04
Re: need a script to split inputs to a-m and n-z for robocop
heh, looks even better now... thnx again.