LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 07-11-2012, 05:53 AM   #1
jsaravana87
Member
 
Registered: Aug 2011
Location: Chennai,India
Distribution: Redhat,Centos,Ubuntu,Dedian
Posts: 558
Blog Entries: 5

Rep: Reputation: Disabled
Command to take incremental backup using tar


Hi
I tried to take incremental backup using tar command ,But it get fails with following error Cannot stat: No such file or directory.But actually i have file content on following path.Any help regarding incremental backup commands


Quote:
root@dragon:~# cd /var/log/mysql
mysql/ mysql.err mysql.log.1.gz mysql.log.2.gz mysql.log.3.gz mysql.log.4.gz mysql.log.5.gz mysql.log.6.gz mysql.log.7.gz
Quote:
root@dragon:~# tar --create --file=archive1.tar listed-incremental=/var/log/mysql.log.4.gz /backup/
tar: listed-incremental=/var/log/mysql.log.4.gz: Cannot stat: No such file or directory
tar: Removing leading `/' from member names
tar: Exiting with failure status due to previous errors

Last edited by jsaravana87; 07-11-2012 at 05:55 AM.
 
Old 07-11-2012, 06:31 AM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
I am not familiar with "listed incremental", but a quick glance at the man page says you do not want that "=". As you can see from the error message, tar is seeing this whole string as the filename:
Quote:
listed-incremental=/var/log/mysql.log.4.gz
Also, "--" is required in front of "listed-incremental"
 
Old 07-11-2012, 06:35 AM   #3
LittleMaster
Member
 
Registered: Jun 2012
Posts: 121
Blog Entries: 1

Rep: Reputation: Disabled
Hi


Try out these commands

tar -cvf backup1.tar --listed-incremental=/var/log/usr.snar /home

Last edited by LittleMaster; 07-11-2012 at 06:39 AM.
 
Old 07-11-2012, 06:39 AM   #4
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
As I stated, the man page does not specify the "=". Are you saying that it actually works that way? (Same issue for --file)
 
Old 07-11-2012, 08:13 AM   #5
jsaravana87
Member
 
Registered: Aug 2011
Location: Chennai,India
Distribution: Redhat,Centos,Ubuntu,Dedian
Posts: 558

Original Poster
Blog Entries: 5

Rep: Reputation: Disabled
Finally tried out incremental backup using rsync


rsync -vazi --rsh="sshpass -p password ssh -l root" 10.200.2.36:/backup /backup

receiving incremental file list
cd+++++++++ backup/
>f+++++++++ backup/1
>f+++++++++ backup/2
>f+++++++++ backup/3
>f+++++++++ backup/4
>f+++++++++ backup/5
>f+++++++++ backup/6
>f+++++++++ backup/7
>f+++++++++ backup/8
>f+++++++++ backup/9
>f+++++++++ backup/a
>f+++++++++ backup/b
>f+++++++++ backup/c
>f+++++++++ backup/d
>f+++++++++ backup/e
>f+++++++++ backup/f
>f+++++++++ backup/g
>f+++++++++ backup/h
>f+++++++++ backup/i
>f+++++++++ backup/incremental

sent 775 bytes received 1949 bytes 1816.00 bytes/sec
total size is 15 speedup is 0.01

Last edited by jsaravana87; 07-11-2012 at 08:16 AM.
 
Old 07-11-2012, 08:45 AM   #6
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Actually, the info manual does use --listed-incremental=<snar file>
Code:
`--listed-incremental=FILE'
`-g FILE'
     Handle incremental backups with snapshot data in FILE.

   To create an incremental backup, you would use
`--listed-incremental' together with `--create' (*note create::).  For
example:

     $ tar --create \
                --file=archive.1.tar \
                --listed-incremental=/var/log/usr.snar \
                /usr
So does the man page.
Code:
       -g, --listed-incremental=FILE
              handle new GNU-format incremental backup
Look at section 5.2 of the info manual.

Last edited by jschiwal; 07-11-2012 at 08:47 AM.
 
Old 07-11-2012, 10:14 AM   #7
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Code:
[mherring@herring_desk ~]$ man tar|grep -u listed-incremental
     -g, --listed-incremental FILE
           dump level for created listed-incremental archive
OK, so it works with the "=" also

I think the issue was omitting the "--"
 
  


Reply



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
Incremental backup using tar ramecare Linux - Server 6 06-14-2012 09:01 AM
Incremental backup with tar ananthkadalur Linux - Newbie 2 10-10-2011 12:35 PM
incremental backup using tar eaglegst Linux - Software 9 02-01-2009 05:00 PM
incremental backup using tar ARsenthil Linux - General 1 03-19-2008 08:29 AM
Incremental Backup (tar command) maginotjr Slackware 4 07-21-2005 01:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 09:38 PM.

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
Open Source Consulting | Domain Registration