One-time backup

Version 1

This backs up the entire dokuwiki directory into a bz2 tar file. It is a simplified version of the script below. The commands are most likely to be run manually. The commands assume that you are in the parent directory of the dokuwiki install. My entire dokuwiki is in ~/wiki 1). I ran this from ~ . The second and third commands are not really needed, but if you want to have multiple backups, it may help

cd ~
mkdir wikibackup
cd wikibackup/
tar -cjf wiki.tar.bz2 ../wiki

Version 2

A simplified version of the above, with the addition of the current date to the filename, is as follows:

tar -cjf backupDirFromCurrentWorkingDir/nameOfBackupFile.`date '+%d%m%y'`.tar.bz2 ../dirToBeBackedUp/

Explanation of paramaters and options:

  • c - create a new archive
  • j - use bzip2 compression format
  • f - use archive file, named as I say
  • backupDirFromCurrentWorkingDir - You can have your backup files set into a separate directory. Type in an existing directory name here, and it will place your .tar.bz2 backup files into this dir
  • nameOfBackupFile - This is the name of the backup file. Ex: WhateverYouWant.tar.bz2
  • dirToBeBackedUp - Which sub directory do you want backed up? All files and subdirectories under this directory will be packed and zipped up into the .tar.bz2 file

Links

See here for scripts and other advanced alternatives:

1) tilde ~ means home directory, the actual full path is longer
 
wiki/backup.txt · Last modified: 11.28.2012 10:12 by 173.59.243.233
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki