How to create a backup of your files/directories via SSH

Making a regular backup of your personal data is a very good practice to ensure your website is protected if something goes wrong. There are several ways to back up the data. One of them is to use Secure Shell (SSH).

First of all, make sure SSH access is enabled for your hosting account. 

Then navigate to the directory you wish to back up with the cd command. Type ls at any time to view the contents of the folder.

When you have navigated to the folder, type the following command:

tar -vcf mybackupfile.tar.gz. 

Be sure to include the trailing period in the command. You can change mybackupfile to a filename of your choice. Once the process is completed, you will have a single .tar.gz archive with the necessary files inside. The backup file will be created in the same directory you have previously navigated to.

Finally, feel free to log in via FTP and download it