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.

Buscar
Categorías
Read More
Other
Plate Polarizer Market to Reach USD 14.12 Billion by 2034 at 3.1% CAGR
Global Plate Polarizer Market is gaining attention across consumer electronics, automotive...
By Harshada Patil 2026-11-04 12:58:33 0 205
Other
Top 5 Seller Mistakes That Quietly Depress Your Sale Price
Selling a home is a major financial decision, and most sellers naturally want to achieve the...
By Rory Mitchell 2026-11-30 09:42:29 0 143
Health
CAR-T's Next Frontier: Cell-Free Exosomes vs. Solid Tumor Barriers
CAR-T stalls in solid tumors due to CRS, poor stromal penetration, and costly manufacturing....
By Cailynn Johnson 2026-11-18 06:29:57 0 293
Other
Cruise and Marine Logistics: Reliable Maritime Transport Solutions
Introduction Maritime transportation plays a vital role in connecting international markets,...
By Chripan Agency 2026-12-01 09:47:24 0 74
Other
ProZone CC Platform – Explore Tools, Inventory, and Secure Access
Introduction Online platforms often provide different tools and account management features to...
By Moravita Moravita 2026-11-08 01:44:23 0 271
Join JoyLife.in | Earn Money Online with Friends & Fun https://joylife.in