LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-07-2011, 12:49 AM   #1
suresh.k
Member
 
Registered: Aug 2011
Location: Hyderabad, AP, India
Distribution: centos, Ubuntu
Posts: 163
Blog Entries: 1

Rep: Reputation: Disabled
How to take backup with tar command


Hi all,
Iam using federo os, i want to take backup from remote pc in single command, what is the command i have to execute.
I Execute following commands.
But it is not working

tar -cZvf /home/html.tar.bz[Destination] /var/www/html[Source]

tar -cZvf 192.168.10.44:/root/Desktop/html06082011.tar.gz[Destination] /var/www/html/[Source]
it is showing like this
tar: compress: Cannot exec: No such file or directory
tar: Error is not recoverable: exiting now
tar: Removing leading `/' from member names
tar: /var/www/html/
192.168.10.44\:/root/Desktop/html06082011.tar.gz: Cannot open: Input/output error
tar: Error is not recoverable: exiting now
/var/www/html/HumidorDev/
/var/www/html/HumidorDev/var/
/var/www/html/HumidorDev/var/.htaccess
/var/www/html/HumidorDev/var/cache/
/var/www/html/HumidorDev/var/cache/mage--e/
/var/www/html/HumidorDev/var/cache/mage--e/mage---internal-metadatas---a8b_DB_PDO_MYSQL_DDL_catalog_product_index_eav_tmp_1
/var/www/html/HumidorDev/var/cache/mage--e/mage---a8b_DB_PDO_MYSQL_DDL_catalog_product_index_eav_tmp_1
/var/www/html/HumidorDev/var/cache/mage--c/
 
Old 09-07-2011, 01:01 AM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
Use ssh and pipe the tarball to your local machine:
It will work better if you use pubkey authentication and run ssh-agent & ssh-add before hand so you aren't prompted for a passphrase from ssh.

Code:
ssh user@host 'tar -C /var/www/html/ -cZvf - . | cat >/root/Desktop/html06082011.tar.gz
However, I'd recommend ssh'ing as a regular user and never running an X desktop as root.

You could also ssh to the server first and ssh back to the client stream the archive.

Last edited by jschiwal; 09-07-2011 at 01:03 AM.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
RHEL4 backup files using tar command... visitnag Linux - Newbie 3 10-24-2009 04:09 PM
how to use tar command to backup one large file in different tapes? mhtan88 Linux - Newbie 4 11-02-2007 01:25 AM
[SOLVED] Simple tar based backup command? Bryan88 Linux - Newbie 3 04-21-2007 09:04 AM
BackUp & Restore with TAR (.tar / .tar.gz / .tar.bz2 / tar.Z) asgarcymed Linux - General 5 12-31-2006 02:53 AM
Incremental Backup (tar command) maginotjr Slackware 4 07-21-2005 01:04 AM


All times are GMT -5. The time now is 06:13 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration