On Wed, Apr 30, 2008 at 04:55:03PM +0200, Jan Stary wrote:

> Hi all,
> 
> OpenBSD 4.3-current (GENERIC) #0: Wed Mar 19 04:21:24 CET 2008
> 
> As anyone else, I use dump(8) for my backups.
> Now I experience this: I made a full dump a while ago with 
> 
>       dump -0 -a -u -f /backup/dump.var.www /var/www
> 
> Since then, /var/www got much smaller (you wouldn't believe the
> amount of bullshit people put online). If I do the same dump now,
> the resulting dumpfile (/backup/dump.var.www) is as big as before
> - it never gets smaller, eventhough I am dumping a much smaller
> filesystem now. Why is that?
> 
> Of course, this won't happen when if I run e.g.
> 
>       dump -0 -a -u -f - /var/www > /backup/dump.var.www
> 
> because then the dumpfile gets truncated right away. But the dump
> happens inside daily.local, hence I want the > redirection for logging:
> 
>       dump -0 -a -u -f /backup/dump.var.www /var/www > $LOG 2>&1
> 
> What I did is rm -f /backup/dump.var.www and than run the dump again.
> Now the dumpfile IS accordingly smaller.
> 
> Can someone enlighten me?
> Perhaps 'dump -f' does not truncate the file?

Yes, indeed. You can still see that dump originally was written for
tape devices.  Something I should look into one day. 

As a workaround, you can try writing to stdout, and just redirect
stderr for logging, since logging info is written to stderr. Something
like this:

         dump -0 -a -u -f - /var/www > /backup/dump.var.www 2> $LOG
         
        -Otto

Reply via email to