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 --no-tablespaces "<%= @database_params[:name] %>" | lz4 -9 > $T/wiki-<%= @name %>-$D/wiki.sql.lz4
11 ln -s <%= @directory %> $T/wiki-<%= @name %>-$D/www
12 nice tar --create --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 wiki-<%= @name %>-$D | nice gzip --rsyncable -9 > $T/$B
13 nice rsync --preallocate --fuzzy $T/$B backup::backup