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