Bash script to backup Minecraft servers using rdiff-backup
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Bash script to backup Minecraft servers using rdiff-backup CPU and I/O friendly.


minebackup backup [full]             Backup the server.
minebackup listbackups               List current incremental backups.
minebackup restore [<MINUTES>/now]   Restore to snapshot [MINUTES] ago. ("now" for the latest)
minebackup crons                     List configured cronjobs.
-debug                               Enable debug output (Must be the last argument).


As you might see, this script creates a configration file in your `$HOME folder.

Make sure you made all adjustments as your needs for the following variables:


You can also override:

  • RUNBACKUP_NICE (${BIN_NICE} -n19 by default)
  • RUNBACKUP_IONICE (${BIN_IONICE} -c 3 by default)
  • SAY_BACKUP_START (Backup started... by default)
  • SAY_BACKUP_FINISHED (Backup successfully finished. by default)


Bash script

cd /usr/local/src
git clone
ln -s /usr/local/src/ /usr/bin/minebackup
mkdir -p /opt/backups/minecraft
chown -R ${USER} /opt/backups

Cron job examples

To open the crontab in your default editor:

crontab -e

Differential backup every 15 minutes, fullbackup every day at 0:00 am:

*/15 * * * * /usr/bin/minebackup backup
0 0 * * * /usr/bin/minebackup backup full

Differential backup every 5 minutes, fullbackup 2 days at 5:30 am:

*/5 * * * * /usr/bin/minebackup backup
30 5 */2 * * /usr/bin/minebackup backup full

Differential backup every 30 minutes, fullbackup every 7 days at 6:45 pm:

*/30 * * * * /usr/bin/minebackup backup
45 18 */7 * * /usr/bin/minebackup backup full


You need rdiff-backup, nice, ionice and tar binaries to use all features of

apt-get install rdiff-backup tar

(nice and ionice are preinstalled on Debian derivates)