Re: bf_copy question

Matthias Andree <[email protected]> Thu, 30 Jul 2015 02:31:03 +0200
Newsgroups gmane.mail.bogofilter.general
Message-ID <[email protected]>
Am 25.07.2015 um 12:35 schrieb R Kimber:
> On Fri, 24 Jul 2015 14:35:34 +0100
> R Kimber wrote:
> 
>> This may seem a naive question, but what exactly does bf_copy do?
>>
>> the syntax is bf_copy <path>/A <path>/B and the manpage says that it
>> copies a bogofilter working directory to another directory.  But does
>> this mean that it only copies the contents of A to the pre-existing
>> directory B, or does assume B does not exist and tries to create B first?
>> If the latter, what error code does it produce if B already exists?
>>
>> The reason why I ask is that I use it in a backup script and at the point
>> where bf_copy is running I get a message via cron saying
>>    mkdir: cannot create directory ‘<path>/.bogofilter’: File exists
>> the script does not use mkdir, so I'm assuming the error comes from
>> bf_copy.
> 
> Sorry, please ignore thabove.  Whe I wrote it I assumed bf_copy would be
> binary, but I realise it's a script and can now see how it works, and  have
> inserted a test before the offending mkdir.

Hi Richard,

I think the idea was to error out if the output directory already
exists, to avoid overwriting existing data, or writing into a directory
with different databases.

The easiest way to silence the   mkdir   utility about existing
directories is to add a "-p" option to it, but you're treading more
dangerous ground (see previous paragraph).

HTH.
Matthias
_______________________________________________
bogofilter mailing list
[email protected]
https://www.bogofilter.org/mailman/listinfo/bogofilter