How can I backup a directory or my website via SSH? Print

  • 0

To backup complete site files, login via SSH.

While you are in the main dir type:

tar -zcf site_backup.tar.gz public_html

This will create a file named site_backup.tar.gz in your main dir. 

To restore this file as a site type:

gunzip site_backup.tar.gz

Hit enter, then type:

tar -xvf site_backup.tar

Hit enter and your all done. 

If you need to archive your emails stored in your account, you can do the same with "mail" folder. This does not include MySQL database backup if you use databases. Please refer to the MySQL section on how to do the backup.

Was this answer helpful?

« Back