Backing up data on shared hosting and reseller accounts in Ruachost
Regular backups are essential to protect your website files, databases, and emails. While Ruachost maintains server-level backups for disaster recovery, it is your responsibility to create and manage your own backups for maximum security and control.
This article explains how to back up your data manually and automatically on shared hosting and reseller accounts.
Website File Backups
Section titled “Website File Backups”Manual Backups
Section titled “Manual Backups”-
Log in to your account using SSH or cPanel File Manager.
-
To back up your public_html directory via SSH, run:
Terminal window /bin/tar -czvf /home/username/public_html.tar.gz /home/username/public_htmlReplace username with your Ruachost account username.
-
This creates a compressed file (public_html.tar.gz) containing all your website files.
-
Download the file to your local computer for safekeeping.
Automatic Backups with Cron
Section titled “Automatic Backups with Cron”You can schedule backups using cron jobs:
- Log in to cPanel.
- Go to Advanced → Cron Jobs.
- Set the backup interval (daily, weekly, monthly).
- Use the same tar command from above in the cron job.
- Optionally, configure the job to copy the backup to a remote location (e.g., Google Drive, Amazon S3, or another server via SCP/rsync).
MySQL Database Backups
Section titled “MySQL Database Backups”Manual Backups
Section titled “Manual Backups”- Log in to cPanel.
- Go to Databases → phpMyAdmin.
- Select the database you want to back up.
- Click Export and save the
.sqlfile to your computer.
Automatic Backups
Section titled “Automatic Backups”-
Use the mysqldump command in a cron job:
Terminal window mysqldump -u dbuser -p'dbpassword' dbname > /home/username/dbname.sql -
Replace
dbuser,dbpassword, anddbnamewith your actual database credentials. -
Store the
.sqlfile securely or transfer it offsite.
Backups in cPanel
Section titled “Backups in cPanel”cPanel also provides built-in backup tools:
- Log in to cPanel.
- Go to Files → Backup.
- Choose Download a Home Directory Backup or Download a MySQL Database Backup.
- Save the files to your local computer.