Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
update [2010-11-10 10:38]
Joakim Forsgren
update [2010-11-10 11:05]
Joakim Forsgren
Line 10: Line 10:
 <code>rm -fr dokuwiki-2010-11-07* </code> <code>rm -fr dokuwiki-2010-11-07* </code>
  
 +Eller
 +<code>
 +#!/bin/bash
 +TIMESTAMP=`date +%Y-%m-%d-%H.%M`
 +echo ${1}
 +
 +if [[ -z ${1} ]] ; then
 +  echo "No valid argument"
 +  exit
 +fi
 +
 +echo "Backup..."
 +tar czf wiki_backup_${TIMESTAMP}.tgz dokuwiki/
 +echo "Extract..."
 +tar xzf ${1}.tgz
 +echo "Copy..."
 +cp -fr ${1}/* dokuwiki/.
 +echo "Clean up..."
 +rm -fr ${1}*
 +
 +</code>