How to make a tarball backup of public_html

There’s a lot of different (type) of files in the public_html directory of your web server. You should manually back this up, and back it up properly.

I recommend using tar, it can gzip it for you. And it can respect the permissions and relative path. It’s an easy tarball as they call it, that you can upload, download, share between servers. Very handy for testing, cloning, backing up etc.

Note: If you have a MySQL database (or more) used by your website, of course back those up separately.

sudo tar -cvpzf /home/user/backups/description-timestamp-www.tar.gz -C /var/www/example.com public_html

Adjust the paths to your personal setup.

 


Posted

in

by

Tags: