/[adm]/puppet/modules/blog/templates/backup_blog-db.sh
ViewVC logotype

Contents of /puppet/modules/blog/templates/backup_blog-db.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2737 - (show annotations) (download) (as text)
Mon Apr 16 16:03:25 2012 UTC (12 years ago) by dams
File MIME type: application/x-sh
File size: 641 byte(s)
add uk blog
1 #!/bin/sh
2
3 # Initialization
4 PATH_TO_FILE=${PATH_TO_FILE:-<%= blog_db_backupdir %>}
5 [ ! -f $PATH_TO_FILE/count ] && echo 0 > $PATH_TO_FILE/count
6 COUNT=$(cat "$PATH_TO_FILE/count")
7 # Backup each locale DB
8 for locale in de el en es fr it nl pl pt ro ru tr uk
9 do
10 if [ ! -d $PATH_TO_FILE/$locale ]
11 then
12 /bin/mkdir $PATH_TO_FILE/$locale
13 fi
14 /usr/bin/mysqldump --add-drop-table -h localhost blog_$locale | bzip2 -c > $PATH_TO_FILE/$locale/mageia_$locale-$COUNT.bak.sql.bz2
15 done
16 # Check count file to have a week of backup in the directory
17 if [ $COUNT -ne 6 ]
18 then
19 COUNT=$(expr $COUNT + 1)
20 else
21 COUNT="0"
22 fi
23 echo $COUNT > $PATH_TO_FILE/count

Properties

Name Value
svn:eol-style native
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.30