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