backups with screen and ncftp

Posted by alexmoreno on Wed, 23/05/2012 - 10:50

Do you have a BIG database (or databases) in your server as a result of months and years of working? It use to be a hell to download the sql right? One solution is to get a backup ftp in your hosting provider. They are cheap, and the are going to save you a lot of time.

The trick, do the mysql backup maintenance things. Then, it's time to download your ENORMOUS .sql, but not directly to your computer.

First install screen, a usefull app to launch any console script or commad, and be able to let running while even you close your local computer.

Secondly, install ncftp, a wonderful ftp client (i love it).

And, lastly, some magic. Execute:

 

  1. screen
  2. put the file on the  ftp: ncftpput -v -R -u USER -p PASS FTPHOST [DIRECTORYWHERECOPY] [FILE(S)TOCOPY]

 

If file is too big, you can close your terminal with [CONTROL]A+D keys. But, we'll speak in another post about screen.

categorias: