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
Previous revision
update [2010-11-10 11:06]
Joakim Forsgren
update [2022-07-18 13:20] (current)
Line 14: Line 14:
 #!/bin/bash #!/bin/bash
 TIMESTAMP=`date +%Y-%m-%d-%H.%M` TIMESTAMP=`date +%Y-%m-%d-%H.%M`
- +if [[ -f "${1}.tgz" ]] ; then 
-if [[ -${1} ]] ; then +  echo "Backup...
-  echo "No valid argument+  tar czf wiki_backup_${TIMESTAMP}.tgz dokuwiki/  
-  exit+  echo "Extract..." 
 +  tar xzf ${1}.tgz 
 +  echo "Copy..." 
 +  cp -fr ${1}/* dokuwiki/
 +  echo "Clean up..." 
 +  rm -fr ${1}*   
 +else 
 +  echo "No file named: ${1}.tgz"
 fi 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> </code>