How to do a quick backup at console

Linux, Tutorial

So, you are coding your project and you realize that you haven’t done any backups! What is the easiest and fastest way to do backup (I don’t know about speed and difficult of this method, but it works and I like this.)

Dump your databases! (if you have any)

Mysqldump --databases dbname > dump.SQL

Then move to parent directory

cd ..

And do a tar archive

tar cvvf project.tar project/

And voilĂ ! Local backup is ready, let’s move it to safe place in your ftp server…

ftp ftp.example.com

Use ls and cd to find right folder on your server, then move local file with:

put project.tar

Whee! Now you have backups safely on your server! It is possible to write a cron script that backups and uploads your project every hour.

No Comments

Leave a Reply

Allowed tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>