Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 09-07-2011, 01:49 AM   #1
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/[Destination] /var/www/html[Source]

tar -cZvf[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/\:/root/Desktop/html06082011.tar.gz: Cannot open: Input/output error
tar: Error is not recoverable: exiting now
Old 09-07-2011, 02:01 AM   #2
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677
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.

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 02:03 AM.
1 members found this post helpful.


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 05:09 PM
how to use tar command to backup one large file in different tapes? mhtan88 Linux - Newbie 4 11-02-2007 02:25 AM
[SOLVED] Simple tar based backup command? Bryan88 Linux - Newbie 3 04-21-2007 10:04 AM
BackUp & Restore with TAR (.tar / .tar.gz / .tar.bz2 / tar.Z) asgarcymed Linux - General 5 12-31-2006 03:53 AM
Incremental Backup (tar command) maginotjr Slackware 4 07-21-2005 02:04 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:04 PM.

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