Backing up DokuWiki

This is how I backup my DokuWiki:

  • backup-dokuwiki.sh
#!/bin/bash
name=$GOOGLE_DRIVE_DIRECTORY/$(date -Is).tar.xz
sudo tar cJf ${name} /var/lib/dokuwiki
drive push -no-prompt ${name}
rm -rf ${name}

Add the following into crontab:

0       4       *       *       *       $HOME/bin/backup-dokuwiki.sh 2>&1

I get the the following email everyday:

Return-path: <A_CERTAIN_USER@fangfufu.co.uk>
Envelope-to: A_CERTAIN_USER@fangfufu.co.uk
Delivery-date: Mon, 25 Jul 2016 04:10:57 +0100
Received: from A_CERTAIN_USER by gabriel.fangfufu.co.uk with local (Exim 4.87)
        (envelope-from <A_CERTAIN_USER@fangfufu.co.uk>)
        id 1bRWID-0005xV-Ca
        for A_CERTAIN_USER@fangfufu.co.uk; Mon, 25 Jul 2016 04:10:57 +0100
From: root@fangfufu.co.uk (Cron Daemon)
To: A_CERTAIN_USER@fangfufu.co.uk
Subject: Cron <A_CERTAIN_USER@gabriel> /home/A_CERTAIN_USER/bin/backup-dokuwiki.sh 2>&1
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Cron-Env: <PATH=/home/A_CERTAIN_USER/go-path/bin:/home/A_CERTAIN_USER/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games>
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/home/A_CERTAIN_USER>
X-Cron-Env: <LOGNAME=A_CERTAIN_USER>
Message-Id: <E1bRWID-0005xV-Ca@gabriel.fangfufu.co.uk>
Date: Mon, 25 Jul 2016 04:10:57 +0100

tar: Removing leading `/' from member names
Resolving...