LinuxQuestions.org
Visit the LQ Articles and Editorials section
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, 06:53 AM   #1
arun5002
Member
 
Registered: Aug 2011
Location: Chennai,India
Distribution: Redhat,Centos,Ubuntu,Dedian
Posts: 549
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 arun5002; 07-11-2012 at 06:55 AM.
 
Old 07-11-2012, 07:31 AM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729
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, 07:35 AM   #3
LittleMaster
Member
 
Registered: Jun 2012
Posts: 98
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 07:39 AM.
 
Old 07-11-2012, 07:39 AM   #4
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729
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, 09:13 AM   #5
arun5002
Member
 
Registered: Aug 2011
Location: Chennai,India
Distribution: Redhat,Centos,Ubuntu,Dedian
Posts: 549
Blog Entries: 5

Original Poster
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 arun5002; 07-11-2012 at 09:16 AM.
 
Old 07-11-2012, 09:45 AM   #6
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655
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 09:47 AM.
 
Old 07-11-2012, 11:14 AM   #7
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729
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


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


All times are GMT -5. The time now is 11:16 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration