Bacula-users

[Bacula-users] removing trailing spaces from files/dirs during restore

2009-12-13 12:33:57
Subject: [Bacula-users] removing trailing spaces from files/dirs during restore
From: Gavin McCullagh <gavin.mccullagh AT gcd DOT ie>
To: bacula-users AT lists.sourceforge DOT net
Date: Sun, 13 Dec 2009 17:30:23 +0000
Hi,

we're doing a restore from bacula to a Windows NAS.  We've found that the
fileset has a number of files in it which have trailing spaces, eg a
directory in the tree is called "Agent ".  We also want to drop the drive
letter prefix off and restore to the exact location they cae from.  Moving
very large directory trees around on Windows can be slow to put it mildly.

I've tried using regular expressions to sort these two issues out in one
go.  Removing the prefix is easy, but removing the space is harder.  For
the particular example above, I can use this:

        !e:/e!e:/!,!Agent !Agent!

which works fine.  However, I've not been able to work out a general
expression for removing trailing spaces.  As an experiment, I tried:

        !e:/e!e:/!,! !!

expecting to remove the first space in every folder.  However, that didn't
seem to match anything -- no spaces were removed.  I've tried various other
combinations like !\ $!! and ! $!! but all to no avail.  

Can anyone suggest how best to do this?

Thanks,
Gavin


------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users

<Prev in Thread] Current Thread [Next in Thread>
  • [Bacula-users] removing trailing spaces from files/dirs during restore, Gavin McCullagh <=