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

0
51

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.

Αναζήτηση
Κατηγορίες
Διαβάζω περισσότερα
άλλο
BIS Standards and Compliance for Batteries Used in Solar PV Systems
Solar energy is becoming an important part of India's renewable energy sector. With the growing...
από Marketing Offpage 2026-11-03 09:37:40 0 415
άλλο
Drop Dead Horns: A Unique Expression of Alternative Streetwear Fashion
Introduction Streetwear fashion continues to evolve as people search for clothing that reflects...
από Drop Clothing 2026-11-28 09:20:32 0 178
άλλο
Homestay in Lonavala with Swimming Pool: Enjoy a Perfect Weekend Getaway
Planning a relaxing vacation away from the busy city lifestyle? Lonavala is one of the most...
από Himanshu Mittal 2026-11-28 15:38:25 0 171
Health
Biofeedback Instrument Market – Growing Demand for Mental Health and Stress Management Solutions
The Biofeedback Instrument Market is witnessing increasing demand as awareness of mental health,...
από Justin Bader 2026-11-25 09:02:04 0 167
Shopping
Where Can You Buy Verified Stripe Accounts Online Today?
Buy Verified Stripe Accounts 👉 Visit Now:...
από Thomas Henry 2026-10-22 17:54:54 0 515
Join JoyLife.in | Earn Money Online with Friends & Fun https://joylife.in