diff options
Diffstat (limited to 'modules')
-rwxr-xr-x | modules/blog/templates/backup_blog-files.sh | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/modules/blog/templates/backup_blog-files.sh b/modules/blog/templates/backup_blog-files.sh new file mode 100755 index 00000000..982bb847 --- /dev/null +++ b/modules/blog/templates/backup_blog-files.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +# Initialization +PATH_TO_FILE=${PATH_TO_FILE:-/var/lib/blog/backup} +[ ! -f $PATH_TO_FILE/count ] && echo 0 > $PATH_TO_FILE/count +COUNT=$(cat "$PATH_TO_FILE/count") +# Backup each locale DB +for locale in de el en es fr it nl pl pt ro ru tr +do + if [ ! -d $PATH_TO_FILE/$locale ] + then + /bin/mkdir $PATH_TO_FILE/$locale + fi + rsync -avHP --delete /var/www/html/blog.mageia.org/$locale $PATH_TO_FILE/$locale/$locale-$COUNT +done +# Check count file to have a week of backup in the directory +if [ $COUNT -ne 6 ] +then + COUNT=$(expr $COUNT + 1) +else + COUNT="0" +fi +echo $COUNT > $PATH_TO_FILE/count |