Business inquiries

[email protected]

Sales department

@bithosting_sales

Technical support

@bithosting_tech

🔁 Automatic Backup on VPS

Regular backups are critical for the safety and stability of any project. Data loss due to failure, hacking, or human error can be devastating. In this article, you'll learn how to configure automatic backups on your VPS using cron, rsync, tar, and remote storage.

🛠 What Can Be Backed Up

⏱ Cron Backup Example

Create a bash script /root/backup.sh:

#!/bin/bash
DATE=$(date +"%Y-%m-%d")
BACKUP_DIR="/backups/$DATE"
mkdir -p $BACKUP_DIR

# Website and DB backup
tar -czf $BACKUP_DIR/site.tar.gz /var/www/html
mysqldump -u root -pYOURPASS dbname > $BACKUP_DIR/db.sql

# Remove old backups
find /backups/* -mtime +7 -exec rm -rf {} \;
  

Add to crontab:

0 3 * * * bash /root/backup.sh > /dev/null 2>&1
  

The script will run every day at 3:00 AM and keep backups for 7 days.

☁ Remote Storage and Cloud

📌 Best Practices from Bit.Hosting

← Back to “Backup” section

If you're unsure how to implement automatic backups on your VPS — contact Bit.Hosting support. We’ll help you set up a secure and reliable backup! 💾

BIT.HOSTING

Your path to perfection

Maximum Performance

Stable servers and modern hardware ensure fast and reliable operation of your services.

Ultimate Configuration Flexibility

Support for various OS and control panels lets you tailor your hosting environment to your exact needs.

Affordable Server Prices

We offer some of the most competitive and accessible prices on the market.

24/7 Customer Support

Our experts are here to assist you anytime — with advice, solutions, or technical help around the clock.