Restore a Linux File Backup

SimpleBackups founder

Laurent Lemaire

Co-founder, SimpleBackups

June 10, 2020

This tutorial explains how you can restore a linux file backup of, for example the /var/www directory on your server.

Step 1

Assuming you have a link of the tar archive you want to restore for /var/www.

Step 2 (optional)

If you are using SimpleBackups, you can go to your backup page, under the "Backup History" section click the little "i" on the right, then click "Raw Download Link" and copy the output.

SimpleBackups File Restore

Step 3

On your server, run the following command, replace the raw download link you obtained in the previous step:

wget "TarBackupLinkHereBetweenTheQuotes" -O "backup.tar.gz"

Step 4

Now that you downloaded the backup on your server, restore it as shown below by running:

tar --overwrite -xvf backup.tar.gz --directory /var/www

\
Note:
this will overwrite your /var/www directory by the one in the backup archive. It is a good practice to extract the backup in a temp folder first and inspect it.



Back to blog

Stop worrying about your backups.
Focus on building amazing things!

Free 7-day trial. No credit card required.

Have a question? Need help getting started?
Get in touch via chat or at [email protected]

Customer support with experts
Security & compliance
Service that you'll love using