pictures

Quick Site Backup (files and database) Via the Command Line

hr
hr Heading 2 Icon Quick Site Backup (files and database) Via the Command Line

If you do any sort of web development, it is more than likely that CPANEL and phpMyAdmin are good friends of yours...and you depend on them. Even though those are extremely handy to create/modify databases and create backups, it is extremely helpful to know how to do the same thing by using only SSH and command line utilities.

To backup (export) a database using the command line interface (CLI):

CODE:
mysqldump -p --user=username --add-drop-table database> backup.sql

You will then need to provide your database password and the exported data will go into a file called "backup.sql" which is located in the directory that you are currently in. (more mysqldump documentation

To backup your files:

CODE:
tar -cvzf backup.tgz directoryname

The command will create an archive of all your files so you can easily move or store one file (the archive). More tar documentation.


search

subscription information

Blog RSS

Comments RSS



Powered by FeedBlitz

blog categories

blog tags

most popular posts

  1. jappler recommends: room & board (store).
  2. using parallels and windows for web development debugging.
  3. another good first tuesday in november.
  4. remove all .svn directories in a directory.
  5. wordpress newsletter plugin.
  6. Add a "Pseudo" Pseudo Class Hover in Inline CSS.
  7. php live training.
  8. so long, farewell ben!
  9. css containers: one image, fixed width, rounded corners.
  10. feel better soon joe paterno.

blog archive

standards

Get Firefox!
XHTML
CSS