diff options
Diffstat (limited to 'modules/blog/templates/backup_blog-files.sh')
| -rwxr-xr-x | modules/blog/templates/backup_blog-files.sh | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/modules/blog/templates/backup_blog-files.sh b/modules/blog/templates/backup_blog-files.sh index 3d66caa0..e268ad2b 100755 --- a/modules/blog/templates/backup_blog-files.sh +++ b/modules/blog/templates/backup_blog-files.sh @@ -1,17 +1,18 @@ -#!/bin/sh +#!/bin/bash # Initialization PATH_TO_FILE=${PATH_TO_FILE:-<%= blog_files_backupdir %>} [ ! -f $PATH_TO_FILE/count ] && echo 0 > $PATH_TO_FILE/count COUNT=$(cat "$PATH_TO_FILE/count") # Backup each locale -for locale in de el en es fr it nl pl pt ro ru tr uk +for locale in de el en es fr it nl pl pt ro ru sv tr uk do if [ ! -d $PATH_TO_FILE/$locale ] then /bin/mkdir $PATH_TO_FILE/$locale fi - tar Jcf $PATH_TO_FILE/$locale/$locale-$COUNT.tar.xz <%= blog_location %>/$locale + # use relative paths to avoid "Removing leading `/' from member names'" warning + tar -C / -Jcf "$PATH_TO_FILE/$locale/$locale-$COUNT.tar.xz" "$(sed s,^/,, <<< "<%= blog_location %>/$locale")" done # Check count file to have a week of backup in the directory if [ $COUNT -ne 6 ] |
