Skip to main content
← All Guides
Server Admin · 8 min read

How to Backup Your Server Automatically, Cron & Plugins

Set up automated Minecraft server backups using Pterodactyl schedules, Linux cron jobs, and plugins like DriveBackupV2 with cloud storage and Discord notifications.

Manual Backups Are Not Enough

If your backup strategy is "I'll remember to download the world folder every few days," you do not have a backup strategy. Human memory is unreliable, and the one time you forget to back up will inevitably be the day before something goes wrong. Automated backups run on a schedule, require no intervention, and guarantee that you always have a recent snapshot to restore from. The setup takes 15-30 minutes depending on your method, and after that, it runs itself indefinitely.

For a refresher on what to include in backups and how to restore them, see the backup and restore fundamentals guide.

Option 1: Pterodactyl Scheduled Backups

If your server runs on a Pterodactyl panel (most managed hosting providers use it), this is the quickest automated backup method available.

  1. Open your server in the Pterodactyl panel.
  2. Navigate to Schedules in the left sidebar.
  3. Click Create Schedule.
  4. Name it "Daily Backup" and set the cron expression. For a daily backup at 04:00 server time: minute 0, hour 4, day of month *, month *, day of week *.
  5. Save the schedule, then click into it and add a new task.
  6. Set the task type to Create Backup.
  7. Optionally add ignored files (e.g., *.jar if you do not want to back up server jars to save space).
  8. Save the task.

Pterodactyl will now create a backup every day at 04:00. When you hit your plan's backup slot limit (typically 3-5 on shared hosting), it will rotate out the oldest backup automatically. You can download any backup from the Backups tab and restore with a single click.

For extra safety, add a second schedule that runs weekly and locks the backup (right-click the backup after creation and select "Lock"). Locked backups are not auto-rotated, so you maintain a longer-term safety net alongside your daily snapshots.

Option 2: Linux Cron Jobs

If you have SSH access to your server (VPS, dedicated machine, or a host that provides shell access), cron jobs give you complete control over the backup process.

Writing the Backup Script

Create a script that stops saving, archives the server files, and resumes:

#!/bin/bash
# backup.sh, Minecraft server backup script
SERVER_DIR="/home/minecraft/server"
BACKUP_DIR="/home/minecraft/backups"
DATE=$(date +%Y%m%d-%H%M)
MAX_BACKUPS=7

# Send save-off to the running server via screen/tmux
screen -S minecraft -p 0 -X stuff "save-all$(printf '\r')"
sleep 5
screen -S minecraft -p 0 -X stuff "save-off$(printf '\r')"
sleep 2

# Create the backup
tar -czf "$BACKUP_DIR/backup-$DATE.tar.gz" \
  "$SERVER_DIR/world" \
  "$SERVER_DIR/world_nether" \
  "$SERVER_DIR/world_the_end" \
  "$SERVER_DIR/plugins" \
  "$SERVER_DIR/server.properties" \
  "$SERVER_DIR/bukkit.yml" \
  "$SERVER_DIR/spigot.yml"

# Resume saving
screen -S minecraft -p 0 -X stuff "save-on$(printf '\r')"

# Rotate old backups, keep only the last N
ls -t "$BACKUP_DIR"/backup-*.tar.gz | tail -n +$((MAX_BACKUPS + 1)) | xargs -r rm --

echo "Backup completed: backup-$DATE.tar.gz"

Make it executable with chmod +x backup.sh.

Scheduling With crontab

Open the crontab editor:

crontab -e

Add a line to run the script daily at 04:00:

0 4 * * * /home/minecraft/backup.sh >> /home/minecraft/backups/backup.log 2>&1

The output is redirected to a log file so you can check whether backups completed successfully.

Backup Rotation Strategy

Keeping every backup forever will eat through your disk space. A solid rotation scheme is:

TypeFrequencyRetention
DailyEvery day at 04:00Keep the last 7
WeeklyEvery Sunday at 04:00Keep the last 4
Monthly1st of each monthKeep the last 2

You can implement this with separate cron entries and backup directories, or use a more sophisticated script that tags backups by type and rotates each category independently.

Option 3: DriveBackupV2 Plugin

DriveBackupV2 is a server plugin that creates backups and uploads them to cloud storage without requiring SSH access or cron jobs. It runs entirely within your Minecraft server and supports Google Drive, OneDrive, Dropbox, and remote FTP/SFTP servers.

Installation and Setup

  1. Download DriveBackupV2 from SpigotMC and drop it in plugins/.
  2. Restart the server. The plugin creates its config at plugins/DriveBackupV2/config.yml.
  3. Link your cloud storage account. For Google Drive, run /drivebackup linkaccount googledrive in-game or in the console. The plugin provides a URL, visit it, sign in to your Google account, authorize access, and paste the code back into the server.
  4. Configure what to back up in config.yml:
backup-list:
 , path: "world"
    format: "zip"
    create: true
 , path: "world_nether"
    format: "zip"
    create: true
 , path: "world_the_end"
    format: "zip"
    create: true
 , path: "plugins"
    format: "zip"
    create: true

schedule:
  backup-delay: 1440  # minutes between backups (1440 = 24 hours)
  backup-count: 7     # number of backups to keep per destination

Discord Notifications

DriveBackupV2 can send a message to a Discord channel when a backup completes or fails. Create a webhook in your Discord server (Server Settings → Integrations → Webhooks), copy the URL, and add it to the plugin config:

notifications:
  discord:
    enabled: true
    webhook-url: "https://discord.com/api/webhooks/YOUR_WEBHOOK_URL"

You will get a message in your designated channel every time a backup finishes, so you know it is working without having to check manually.

Backing Up to Remote Storage

Local backups protect against world corruption and accidental deletion. They do not protect against disk failure, hosting provider issues, or account problems. For real disaster recovery, at least one copy of your backups should exist on a completely separate system. Your options include:

  • Cloud storage (Google Drive, OneDrive) via DriveBackupV2
  • Remote FTP/SFTP server, many backup scripts and plugins support uploading to a remote server
  • Manual download, download a backup to your local machine weekly and keep it there
  • Rsync, for VPS users, rsync to a second VPS or a home server over SSH

Testing Automated Restores

Set a recurring calendar reminder to test your backup restoration process. Every 4-6 weeks, download a backup, spin up a local test server, extract the backup into it, and verify that the world loads, player data is intact, and plugins function. This catches problems like backup scripts that silently fail, archives that are incomplete, or cloud storage quotas that prevent uploads.

Your backup system is only as reliable as your last successful test restore. Do not skip this step.

Storage Space Management

Backups accumulate quickly. A mid-size server with a 5 GB world creates roughly 35 GB of daily backups per week before compression. Monitor your disk usage and set up alerts if backup storage exceeds 80% capacity. Compression helps substantially, a Minecraft world typically compresses to 30-50% of its original size with gzip or zip, but you still need to stay on top of rotation and cleanup. Delete test backups promptly and review your retention policy if storage costs are climbing.

Looking for reliable hosting? Astroworld Hosting runs NVMe SSD, Pterodactyl panel, daily backups, and DDoS protection. See features , plans from €6.39/mo.

Related Tools & Resources

🔧

Minecraft Tools

Calculators, generators & server tools

🧱

Item Database

Browse all Minecraft items, stats & recipes

⚒️

Crafting Recipes

Visual crafting guides for every recipe