I just hacked sendsize.c to use calcsize iso gnutar to estimate dumpsizes.
The speed difference is enorm.
Whereas gnutar took well over 4 hours to get the estimates using calcsize
gives results within 45 minutes.
Now my question is:
1) Why is gnutar used in stead of calcsize ?
2) Are there any dangers in running calcsize ?
I gather from readiong the source, the changelog, and some searching on the
egroups list that calcsize should give the same numbers as gnutar .
At any rate,
Attached below my (small) hack to sendsize.c
(basically I moved the #ifndef USE_GENERIC_CALCSIZE 3 lines lower).
Im not sure if this is the intedned behaviour
(as it is now, it still uses DUMP to get dump estimates, and calcsize for
everything else. I noticed dump on SGI returning within seconds with a
correct estimate, and calcsize isn;t going to beat that ;) )
May I suggest the following changes for Amanda 2.5 (or whatever :) )
1) change USE_GENERIC_CALCSIZE into USE_CALCSIZE_FOR_GNUTAR
(or something like that ;) )
2) add an option to ./configure to set this as a #define in config.h
(heck, I'd happily do so myself, but I do not know what the procedure is ).
void calc_estimates(est)
disk_estimates_t *est;
{
dbprintf(("calculating for amname '%s', dirname '%s'\n", est->amname,
est->dirname));
if (maxdumps > 1) {
while(dumpsrunning >= maxdumps) {
wait(NULL);
--dumpsrunning;
}
++dumpsrunning;
switch(fork()) {
case 0:
break;
case -1:
error("calc_estimates: fork returned: %s", strerror(errno));
default:
return;
}
}
/* Now in the child process */
if(strcmp(est->program, "DUMP") == 0)
dump_calc_estimates(est);
else
#ifndef USE_GENERIC_CALCSIZE
# ifdef SAMBA_CLIENT
if (strcmp(est->program, "GNUTAR") == 0 &&
est->amname[0] == '/' && est->amname[1] == '/')
smbtar_calc_estimates(est);
else
# endif
# ifdef GNUTAR
if (strcmp(est->program, "GNUTAR") == 0)
gnutar_calc_estimates(est);
else
# endif
#endif
generic_calc_estimates(est);
if (maxdumps > 1)
exit(0);
}
gerhard, <@jasongeo.com> == The Acoustic Motorbiker ==
--
__O "Hello. Welcome to Hell. I am, of course, the Devil. Now, we'll start be
=`\<, separating you all into lots. First, the Germans. You knew that was
(=)/(=) coming, didn't you? Over here. Next, the French. You can go stand by
the Germans. Atheists over here. I bet you feel bloody stupid right now
eh? Christians, over here. What? Oh, I'm sorry, but it turns out the
Jews were right...