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

0
50

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
Art
Taishan VPN Registration and Setup Guide: Get Started Fast
Why Choose Taishan VPN?Taishan VPN is a privacy-focused service built for users who want a fast,...
Por John Henry 2026-11-23 15:37:27 0 190
Outro
Global Graphite Polystyrene Foam Board Market to Reach USD 4.85 Billion by 2034
The global Graphite Polystyrene Foam Board Market is witnessing steady growth, driven by...
Por Harshada Patil 2026-11-18 11:14:07 0 131
Outro
BIS Consultant for Power Inverters: Expert Guide to BIS Compliance
Power inverters play an important role in solar energy systems by converting direct current (DC)...
Por Marketing Offpage 2026-11-02 20:11:22 0 404
Outro
Ballistic Composite Material Market to Reach USD 2,432.81 Million by 2032 at 5.50% CAGR
 The global Ballistic Composite Material Market is gaining attention across the defense and...
Por Harshada Patil 2026-11-23 10:27:33 0 153
Outro
Homestay in Lonavala with Private Pool: Enjoy a Perfect Luxury Getaway
Planning a relaxing holiday away from the busy city? Lonavala is one of the most popular...
Por Raj Kumar 2026-10-14 11:17:23 0 387
Join JoyLife.in | Earn Money Online with Friends & Fun https://joylife.in