How to Automate Daily Off-Site Backups and Snapshots on a VPS in Spain

0
60

Suppose a customer asks for an invoice on Friday, and you discover that someone deleted its PDF on Monday. Last night’s backup faithfully copied a site where the invoice was already missing. A backup from Sunday could recover it. Now consider a different problem: you lose access to the hosting account that holds both your Madrid VPS and its snapshots.

These two failures call for different decisions. Retention determines how far back you can go. Storage location and account access determine whether you can reach that history during an outage. For a small WordPress or business site, a practical setup combines daily server snapshots, an encrypted off-site backup made with Restic, and a regular test that restores a real piece of the application.

Decide what each copy will recover

The 3-2-1 rule calls for three copies of important data, across two types of storage media, with one copy off-site. Start by writing down where each copy lives and which account can retrieve it. A second directory on the production disk disappears with the first. A provider snapshot may survive disk failure but still depend on access to the same hosting account.

For a Spain VPS, use the provider’s snapshot scheduler, if available, to create a daily recovery point. Record which volumes it covers, how long snapshots remain available, and whether restoring one replaces the running server or creates a separate instance. If you are evaluating OnliveServer, these are useful questions to settle before choosing a plan. Give the off-site repository its own storage account and recovery credentials. Confirm the underlying media separately if your organization requires strict 3-2-1 compliance.

Back up the records behind the website

For a WordPress store, list what you would need to recover one complete order. The order details may be in the database, its invoice in an uploads directory, and the plugin that generates the invoice in the application files. Someone rebuilding the site also needs its configuration. A backup that contains the product photos and theme can look convincing until the first customer asks about a purchase.

Create a fresh, consistent database export using the backup method supported by your database engine. Write it to a protected staging directory. Have the job check that the export completed successfully before replacing the previous export and starting Restic. Otherwise, a failed export on Tuesday can leave Monday’s database file in place, ready to be included in a snapshot labeled Tuesday. For applications that update files and database records together, coordinate those writes during capture so both copies represent a recoverable state.

Run the first Restic backup before scheduling it

Restic calls each saved version of a set of files a snapshot. A Restic snapshot can recover an individual invoice or configuration file. A hosting provider’s VPS snapshot serves a different purpose, such as rolling back a machine after an unsuccessful update. Keeping both gives the operator a choice during recovery.

The following Linux example assumes Restic is installed, the backup user has SSH access to a separate off-site storage server, and /srv/backup-staging contains a completed database export. Replace the example hostname and paths with your own. Create the password file with access restricted to the backup user, and keep a recovery copy in a password manager accessible independently of the VPS.

export RESTIC_REPOSITORY='sftp:backup@backup.example.org:/srv/restic/madrid-site'
export RESTIC_PASSWORD_FILE='/etc/restic/madrid-site.password'

# Run once for a new repository.
restic init

# Run after each successful database export.
restic backup --tag madrid-site /var/www/site /srv/backup-staging

 

Run the first backup manually. Check that the resulting snapshot lists the expected directories and that a recent database export is present. Then schedule the export and backup together. For example, this cron entry runs a wrapper script daily at 02:15 in the scheduler’s configured time zone. The script must load the repository settings itself, stop on an export error, and report a failed or incomplete backup.

restic forget --tag madrid-site \
  --keep-daily 7 --keep-weekly 4 --keep-monthly 6 --dry-run

If backups contain customer records, document who can restore them, where the off-site copy resides, and why each retention period is necessary. Under GDPR, the security measures appropriate to the risk include timely recovery of access to personal data and regular testing of those measures. Hosting the production VPS in Madrid answers only the location question for that machine.

Prove that one order can be recovered

Pick a dated snapshot and restore it into an isolated directory. Import its database into a test instance with outbound email and payment processing disabled. Find an order placed shortly before the backup, open its invoice, and compare the amount and date. Record the snapshot ID, the newest order recovered, and the elapsed restore time. Those three details tell the business what it could recover after an outage and how long customers might have to wait.

Pesquisar
Categorias
Leia Mais
Health
Meta Burn Review – Discover Its Ingredients, Features & Potential Benefits
Meta Burn is receiving significant interest from individuals searching for easy methods to assist...
Por Meta Burn 2026-10-23 05:31:47 0 443
Health
Blood Glucose Monitoring Market – Growing Demand for Advanced Diabetes Management Solutions
The Blood Glucose Monitoring Market is witnessing significant growth due to the increasing...
Por Justin Bader 2026-11-23 12:37:22 0 206
Outro
Monday morning
I checked the result before I checked my emails, which is not my best habit but there it is....
Por Olivia Cooper 2026-11-30 19:09:48 0 89
Outro
What Defines Luxury Living in Modern Chennai?
Luxury living has evolved beyond large spaces and expensive interiors. Today, people look for...
Por Kavin Rajj 2026-11-26 08:48:22 0 181
Outro
Event Logistics Market Forecast: Reaching USD 152.52 Billion by 2035 at 6.24% CAGR
According to Market Research Future® (MRFR), the Event Logistic Market is projected to grow...
Por Jon Snow 2026-11-30 07:04:54 0 124
Join JoyLife.in | Earn Money Online with Friends & Fun https://joylife.in