[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Problem using "svnadmin dump" in a cron job

From: Robert Dailey <rcdailey_at_gmail.com>
Date: Sun, 20 Jul 2008 22:09:32 -0500

On Sun, Jul 20, 2008 at 9:21 PM, Ryan Schmidt
<subversion-2008c_at_ryandesign.com> wrote:
> On Jul 20, 2008, at 12:28, Robert Dailey wrote:
>
>> I'm currently using crontab to setup a backup script that runs at
>> various intervals to backup my subversion repository. First, it
>> performs an "svnadmin dump" as user 'root' in Ubuntu Server 8.04.
>> Next, it utilizes the '7z' program to compress the dump file. I'm
>> having an issue right now where the dump process will just cease to
>> continue at any given random location in the dump process. For
>> example, it might go all the way up to revision 26 and then stop
>> there, instead of performing the dump for all revisions in the
>> repository. The revision that the dump stops at seems to be random.
>>
>> <snip>
>
> You should log the stderr output too, not just the stdout output. This way
> when an error occurs you should know why.
>
> svnadmin dump /var/svn/repo/personal > ${filepath}.tmp_dump 2>&1
>
>
>> echo "Dump process finished"
>> if [ "$?" != "0" ]; then
>> echo "Failed to generate dump file"
>
> Usually you would print errors to stderr, not stdout.
>
> echo "Failed to generate dump file" 1>&2
>
>
>> exit 1
>> fi
>>
>> # Attempt to compress the dump file
>> echo "Beginning to compress dump file..."
>> 7z a -mx=9 -ms=on ${filepath}.7z ${filepath}.tmp_dump
>> echo "Dump file now compressed"
>> if [ "$?" != "0" ]; then
>> echo "Failed to compress the dump file"
>
> Same here.
>
> echo "Failed to compress the dump file" 1>&2
>
>
>> <snip>

Thanks for your help.

I'm still new to linux & bash scripting, so please do forgive any poor
scripts you see. I'll definitely make use of your suggestions, though.
The 1>&2 syntax makes no sense, so I'll have to read about it after I
write this.

I'll try the suggestions you offered and see if I can figure out why
it is failing. Thanks again.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-07-21 05:09:55 CEST

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.