About Me

Josh Lyon

Name: Joshua Lyon
Birthday: August 8, 1985
Location: Grapevine, TX
E-mail: This e-mail address is being protected from spam bots, you need JavaScript enabled to view it

feed image
Home arrow View Blog arrow Josh's Blog arrow Backup site (files) from Shell
Jan 25 2008
Backup site (files) from Shell
Written by Josh Lyon   
Friday, 25 January 2008
 

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.

Related articles.

Add Comment
Name
E-mail
Title  
Comment
 
Available characters: 600
   Notify me of follow-up comments
  Mathguard security question:
 X          7B5      
WN     H      H   3RM
 5    MGN   LAE      
 O     F    U     P2I
TW2         8TY      
   
   

 

No comment posted

Add your comment



mXcomment 1.0.8 © 2007-2008 - visualclinic.fr
License Creative Commons - Some rights reserved
< Prev   Next >