Wiki » Historique » Version 6
Patrice Nadeau, 2014-07-10 12:45
| 1 | 1 | Patrice Nadeau | {{toc}} |
|---|---|---|---|
| 2 | |||
| 3 | 6 | Patrice Nadeau | h1. Readmine |
| 4 | |||
| 5 | h1. Installation |
||
| 6 | |||
| 7 | h2. Prérequis |
||
| 8 | 1 | Patrice Nadeau | |
| 9 | h2. Plugins |
||
| 10 | |||
| 11 | h3. Redmine Rouge |
||
| 12 | 4 | Patrice Nadeau | |
| 13 | 1 | Patrice Nadeau | Plugin pour le "syntax highlight. |
| 14 | 4 | Patrice Nadeau | |
| 15 | "Language supporté":http://rouge.jayferd.us/demo |
||
| 16 | 1 | Patrice Nadeau | |
| 17 | https://github.com/ngyuki/redmine_rouge |
||
| 18 | |||
| 19 | <pre> |
||
| 20 | <code class="bash"> |
||
| 21 | cd /srv/redmine/plugins |
||
| 22 | git clone https://github.com/ngyuki/redmine_rouge.git |
||
| 23 | cd .. |
||
| 24 | bundle install |
||
| 25 | 2 | Patrice Nadeau | # Relancer redmine |
| 26 | rcredmine restart |
||
| 27 | 1 | Patrice Nadeau | </code> |
| 28 | </pre> |
||
| 29 | 5 | Patrice Nadeau | |
| 30 | h1. Copie de securité |
||
| 31 | |||
| 32 | <pre> <code class="bash"> |
||
| 33 | #!/bin/bash |
||
| 34 | # |
||
| 35 | # backup_redmine.sh |
||
| 36 | # Backup of a Redmine setup |
||
| 37 | # Last Changes: 2013-02-23 |
||
| 38 | # Maintainer: Patrice Nadeau <patricen@telwarwick.net> |
||
| 39 | |||
| 40 | # TODO Verify the results (folder exist, enough disk pace , etc..) |
||
| 41 | |||
| 42 | ## The only variable needed to be changed |
||
| 43 | # Directory of the Redmine install |
||
| 44 | declare -r RAIL_ROOT='/srv/redmine' |
||
| 45 | # MySQL database |
||
| 46 | declare -r MYSQL_DB='' |
||
| 47 | # MySQL username for the Redemine db |
||
| 48 | declare -r MYSQL_USER='' |
||
| 49 | # MySQL password for the Redemine db |
||
| 50 | declare -r MYSQL_PASSWORD='' |
||
| 51 | # Directory for the backup (must exist and with no space in the name) |
||
| 52 | declare -r DIR='/root' |
||
| 53 | ## end |
||
| 54 | |||
| 55 | # Exit level |
||
| 56 | declare -ir EXIT_OK=0 |
||
| 57 | declare -ir EXIT_WARNING=1 |
||
| 58 | declare -ir EXIT_ERROR=2 |
||
| 59 | |||
| 60 | declare -i STATUS=$EXIT_OK |
||
| 61 | |||
| 62 | # The directory inside the archive |
||
| 63 | declare -r REDMINE='redmine' |
||
| 64 | TMP_DIR=$DIR/$REDMINE |
||
| 65 | |||
| 66 | # This will be used for the archive file |
||
| 67 | declare -r DST=$DIR/redmine_$(date +%Y%m%d_%H%M%S).tar.gz |
||
| 68 | |||
| 69 | # The temporary sql file |
||
| 70 | declare -r TMP_MYSQL=$TMP_DIR/$MYSQL_DB.mysql |
||
| 71 | |||
| 72 | echo "Backup in progress in $DST" |
||
| 73 | |||
| 74 | #### Create the temp directory #### |
||
| 75 | mkdir $TMP_DIR |
||
| 76 | |||
| 77 | #### backup MySQL #### |
||
| 78 | if [ $STATUS -eq $EXIT_OK ] |
||
| 79 | then |
||
| 80 | STEP='Creating MySQL backup' |
||
| 81 | mysqldump --user=$MYSQL_USER --password=$MYSQL_PASSWORD $MYSQL_DB \ |
||
| 82 | > $TMP_MYSQL |
||
| 83 | STATUS=$? |
||
| 84 | fi |
||
| 85 | |||
| 86 | #### backup the Redmine folder #### |
||
| 87 | if [ $STATUS -eq $EXIT_OK ] |
||
| 88 | then |
||
| 89 | STEP='Creating Redmine'"'"' files backup' |
||
| 90 | cp --recursive $RAIL_ROOT $TMP_DIR |
||
| 91 | STATUS=$? |
||
| 92 | fi |
||
| 93 | |||
| 94 | #### create the archive file #### |
||
| 95 | if [ $STATUS -eq $EXIT_OK ] |
||
| 96 | then |
||
| 97 | STEP="Creating archive" |
||
| 98 | tar --create --gzip --file $DST --directory=$DIR $REDMINE |
||
| 99 | STATUS=$? |
||
| 100 | fi |
||
| 101 | |||
| 102 | #### cleanup #### |
||
| 103 | if [ $STATUS -eq $EXIT_OK ] |
||
| 104 | then |
||
| 105 | STEP='Cleaning up' |
||
| 106 | rm --recursive --force $TMP_DIR |
||
| 107 | STATUS=$? |
||
| 108 | fi |
||
| 109 | |||
| 110 | #### exit #### |
||
| 111 | if [ $STATUS -eq $EXIT_OK ] |
||
| 112 | then |
||
| 113 | echo "Backup done" |
||
| 114 | else |
||
| 115 | echo "Bakup failed with error code $STATUS in step $STEP" |
||
| 116 | fi |
||
| 117 | |||
| 118 | |||
| 119 | exit $STATUS |
||
| 120 | |||
| 121 | </code></pre> |