2 T=`mktemp -d -t -p /var/tmp mediawiki-<%= @name %>.XXXXXXXXXX`
4 B=wiki-<%= @name %>-$D.tar.gz
6 mkdir $T/wiki-<%= @name %>-$D
7 echo '[mysqldump]' > $T/mysqldump.opts
8 echo 'user=<%= @database_params[:username] %>' >> $T/mysqldump.opts
9 echo 'password=<%= @database_params[:password] %>' >> $T/mysqldump.opts
10 mysqldump --defaults-file=$T/mysqldump.opts --opt --skip-lock-tables --single-transaction "<%= @database_params[:name] %>" | lz4 -9 > $T/wiki-<%= @name %>-$D/wiki.sql.lz4
11 ln -s <%= @directory %> $T/wiki-<%= @name %>-$D/www
12 export GZIP="--rsyncable -9" #make backup rsyncable
13 nice tar --create --gzip --dereference --directory=$T --warning=no-file-changed --exclude=wiki-<%= @name %>-$D/www/w/images/thumb --exclude=wiki-<%= @name %>-$D/www/w/.git --exclude=wiki-<%= @name %>-$D/www/w/extensions/*/.git --file=$T/$B wiki-<%= @name %>-$D
14 nice rsync --preallocate --fuzzy $T/$B backup::backup