[Samba] cleanup_recycle.pl problem (maybe OT)

Michael Heironimus mkh01 at earthlink.net
Fri Jan 24 06:44:01 GMT 2003

On Thu, Jan 23, 2003 at 08:16:14AM -0800, hans at sbsfor.com wrote:
> This maybe slightly OT, but I just noticed an interesting difficulty with
> the cleanup_recycle.pl script that comes with 2.2.7a.  I run it on a cron
> job every night, deletes files and directories after 3 days.  The trouble I
> have is that some of my directory are named with spaces in them  ie "Base
> Maps" rather than a more proper "Base_Maps"  The script really doesn't like
> those spaces, it tries to delete "Base" and then stops.  My perl is rather
> non-existent.  I was wondering if anybody out there has run into this and
> figured a work around.  Many thanks.

Looking at that script, I think it probably needs to be rewritten
altogether. But as a quick-fix I think you can probably replace the line
  $r = `rm -f $_ 2> /dev/zero`;
and replace
  $r = `rmdir $_ 2> /dev/zero`;

This assumes you're using perl 5, perl 4 didn't have chomp(). Most
people have perl 5 now, though.

Michael Heironimus

More information about the samba mailing list