Translate This Page

About Me

profile_picture_120

Name: Joshua Lyon
Birthday: August 8, 1985
Location: Valley Ranch (Irving), TX
E-mail: josh@boshdirect.com

Related Articles

Content View Hits : 1258707
Backup site (files) from Shell
Written by Josh Lyon   
Friday, 25 January 2008 07:42

Here's a quick code snippet on how to backup files and restore them from the shell.

To back them up, run the following code:

$ tar -zcvf filename.tar.gz folder/

To backup all files in the directory you are currently in, run:
$ tar -zcvf filename.tar.gz .

Here's a breakout of the parameters:
z - gzip compression
c - compress the files
v - verbose output (lists the files)
f - file

To uncompress the file(s) (eg. unload to server - overwriting files), use the following:
$ tar -zxvf filename.tar.gz

The key difference is the c in the compress command above was replaced with an x for the extract command.

 

Comments (0)

Write comment

smaller | bigger
security image
Write the displayed characters

busy