Knowledgebase

Automating Backups with a Script Print

  • backupsdisasterrecovery, backups, backup, plugins, woocommerce, database, restore, cron, resourcelimits, diskspace
  • 0

Scheduled backups without a plugin.

WHAT A SCRIPT DOES

Dumps each database Archives the files Compresses the result Transfers it to remote storage Removes local copies older than a set age

RUNNING IT

From cron, at a quiet hour.

Redirect output to a log file rather than discarding it, so a failure is visible.

WHY SCRIPT IT

Works regardless of application, so one approach covers several sites No plugin to maintain Complete control over what is included and where it goes

WHAT MATTERS

Store off the server. A script writing archives to your home directory provides no real protection. Include a retention policy, or the archives fill your quota. Log the outcome, and check it. Verify the files exist and are of plausible size.

RESOURCE AWARENESS

Compressing a large account consumes CPU and I/O. Run it when traffic is low.

TESTING

Run it manually first, confirm the archive is complete, and restore from it once.


Was this answer helpful?
Back

Are you happy with your experience? Leave us a review on Trustpilot.


Trustpilot