Hello all,
I have this scritp for take dump the mysql, I hope you can try!
#!/bin/bash
PORT="3306"
USER="root"
PASSWORD="Password"
mysql=/usr/bin/mysql
mysqldump=/usr/bin/mysqldump
TABLES=`$mysql -P $PORT -u $USER --password=$PASSWORD --execute="SHOW
DATABASES;" |awk '{print($1)}' |grep -v "Database" |grep -v
"information_schema"`
for table in $TABLES; do
echo "Backing up $table..."
file=$table.backup_`date +%Y%m%d`.sql
$mysqldump -P $PORT -u $USER --password=$PASSWORD $table > $file
echo "Compressing backup..."
/bin/tar -cvPzf /home/git/backup/backup-mysql-`date \+\%Y\%m\%d`.tar.gz
$file
done
Regards,
2012/7/26 Thomas Kjeldahl Nilsson <[email protected]>
> Hello Carlos (& Bilal),
>
> backing up a Gitorious instance entails the following:
>
> 1: Dump the mysql database state to file (which contains metadata about
> users, projects, repos etc)
>
> 2: Make a recursive copy of the directory where repos are stored (as you
> have already mentioned)
>
> 3: Ssh keys of all users are stored in ~/.ssh/authorized_keys for the
> users that owns/runs the Gitorious instance, so grab that as well (~ e.g
> HOME is the user that owns your Gitorious file structure/services).
>
> 4: The configuration of your local Gitorious instance is of course not in
> our git repos and rebuilding your own config after disaster strikes can be
> a huge pain, so backup the files you have touched/created under
> <GITORIOUS_ROOT>/config.
>
> That should cover most bases; restoring = simply copying/importing the
> data captured above to its original locations.
>
> I don't have a standard script for this to throw over to you, since the
> backup/restore procedure differs based on the config/size of each Gitorious
> instance, but you're right - small internal installations should be able to
> dump (and restore) the whole backup/state to/from a single tarball.
>
> cheers,
> Thomas
>
>
>
> On 07/26/2012 12:26 AM, Carlos wrote:
>
> I have the same question, which I will divide into parts:
>
> A. What is the process for "dumping" the full state of a gitorious
> instance?
>
> B. What is the process of (re)loading a dump to overwrite the state of
> a gitorious instance?
>
> My focus is disaster recovery. So just cloning the project repos is not
> enough. I need the user database, pending queues, merge requests, wikis,
> everything.
>
> The solution for dumping state does not need to be GUI. In fact it
> would be better if it were a script which could run from a cron job every
> night. Ideally the result would be a single file which I would scp to
> offsite storage in case the building burns down.
>
> Thanks!
>
>
> On Tuesday, January 10, 2012 4:55:32 AM UTC-7, Bilal MK wrote:
>>
>> Hello,
>>
>> Anybody please outline proper backup and restore steps?
>>
>> Thanks
>>
> --
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
>
>
>
> --
> best regards,
> Thomas Kjeldahl Nilssonhttp://gitorious.com
>
> --
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
>
--
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]