[Dirvish] Updating/overwriting existing images
Jason Boxman
jasonb at edseek.com
Mon Aug 7 23:47:40 UTC 2006
On Monday 07 August 2006 18:56, Samuel P Howard wrote:
> Hi.
>
> I have a little script set up to automate the running of the "dirvish
> --vault {foo}" jobs, and sometimes the client pushes a new dataset to
> the staging area for dirvish to backup.
>
> However, the configuration is set up for only 1 image per day.
By choice or design?
> So, is there an option for updating or overwriting an existing image? I
> haven't been able to find it, but then again, I may be blind, too.
If you can produce more than one image a day, simply change the image
directory to be something like %Y%m%d%H. Then you can run once an hour
without an collision. Or you can include the minutes and seconds and run
nearly as often as you need.
> As an alternate, I thought of checking the return code, but the RC for
> running a dirvish --vault for an image that already exists comes back
> with RC=224.
>
> 224 is in the 220-254 range ("An error was detected in the
> configuration."), which I wouldn't consider a very accurate description
> of the reason for the failure.
>
> Something like "Image already exists" might be nice. :)
>
> The only option I currently see is to attempt the dirvish command, if it
> fails with a 224, remove the existing directory and re-create it ...
> somehow, I think that will bite me down the road with the indexes,
> however. Also, since 224 is range that sounds more like the config file
> is broken, I wonder what other conditions could return that error code?
If the image does exist, certainly you can check for that before running
Dirvish? You can output the same date format using the `date` command as
Dirvish uses, so you can check for existence ahead of time if you want.
Unless I don't follow, you may be doing more work than you need to.
--
Jason Boxman
http://edseek.com/ - Linux and FOSS stuff
More information about the Dirvish
mailing list