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

0
80

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.

Site içinde arama yapın
Kategoriler
Read More
Other
Honeycomb Cardboard Filler Market to Reach USD 2,681.30 Million by 2034 at 2.45% CAGR
 The global Honeycomb Cardboard Filler Market is gaining attention across the packaging,...
By Harshada Patil 2026-11-23 12:46:57 0 164
Home
Interior Design Firms in Delhi Make Spaces Smarter (2026)
  The right Interior Design Firms in Delhi will ensure that you get an interior that not...
By Interiors India 2026-10-26 10:05:41 0 331
Other
¿Cómo puede una persona hacer la seleccion de asientos Volaris?
Elegir el asiento correcto puede crear una diferencia grande en su experiencia de viaje. No...
By Sky Vuelos 2026-12-04 07:21:54 0 27
Health
Osanix Weight Loss Capsules UK, Potential Benefits, Ingredients, And Official Website
In our current high-speed environment, managing to attain and keep a healthy weight is often...
By NeuroSchutz Kapseln 2026-11-25 19:37:26 0 221
Other
Nickel Anode Market to Reach USD 532 Million by 2032 at 5.1% CAGR
Global Nickel Anode Market is gaining attention across the electroplating, automotive and...
By Harshada Patil 2026-11-13 12:26:25 0 262
Join JoyLife.in | Earn Money Online with Friends & Fun https://joylife.in