How to backup a directory

The following command will put all files in a directory into a tar file. This is very useful when migrating a WordPress website to a new server.

tar -zcvf archive.tar.gz /path/to/directory/*

 

Leave a comment