Skip to content

Instantly share code, notes, and snippets.

@dannyvassallo
Last active September 15, 2015 18:45
Show Gist options
  • Save dannyvassallo/ed175bc87d6e817ec292 to your computer and use it in GitHub Desktop.
Save dannyvassallo/ed175bc87d6e817ec292 to your computer and use it in GitHub Desktop.
SSH into and FTP, Back it up, and copy the backup

#Back up your FTP site with SSH (excluding databases)

Sub in your URLs, username, and folder names. You can practically copy paste these into the terminal and it will work.


  1. SSH into the ftp and enter your password when asked:
ssh username@yourdomain.com
  1. List the directories:
ls
  1. Navigate to the folder you want to compress:
cd directoryname
  1. Run this command to tar the directory:
tar -vcf yourbackupfilename.tar .
  1. Copy the tar to a local folder:
scp -C username@yourdomain.com:/path/of-the-archive/yourbackupfilename.tar /home/mydirectory/backups/

If you have a wordpress and want to back up your site AND your database, visit this forum here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment