LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-17-2009, 08:58 AM   #1
orange.toaster
LQ Newbie
 
Registered: Jun 2009
Posts: 9

Rep: Reputation: 0
Gnu tar --listed-incremental on cifs mount always does full dump


Hi, I am trying to setup a backup system for a windows box. I have the shares mounted with cifs. the command I'm useing is
Code:
tar -cv $Source --no-check-device --absolute-names --listed-incremental=$DestDir/$Info | bzip $DestDir/Backup_$Date.$Iteration.tar.bz2
The problem is that tar picks up all of the folders as having their names changed. I thought that it was from referring to the shares as absolute locations, so I mounted them relative to the script and used relative paths. However, it is still doing a full dump every time.
Does anyone have any experience with tar --listed-incremental?
 
Old 06-17-2009, 08:59 AM   #2
orange.toaster
LQ Newbie
 
Registered: Jun 2009
Posts: 9

Original Poster
Rep: Reputation: 0
I am using gnutar 1.20 and windows server 2k3.
 
Old 06-18-2009, 09:51 AM   #3
orange.toaster
LQ Newbie
 
Registered: Jun 2009
Posts: 9

Original Poster
Rep: Reputation: 0
Functional Alternative

It must be possible because Amanda does this same action without a problem according to this thread: http://www.linuxquestions.org/questi...backup-587030/

Looking through the amanda source code they actually use the line:
Code:
$gnutar --create $verbose --directory $disk --listed-incremental ${gnulist}/${listdir}_${level}.new --sparse --one-file-system --ignore-failed-read --totals --file - .
But even playing around with that I couldn't get it to work for this application.

Alternative: as suggested in the above thread using rdup may be a better way to go. However, one of the attractions of using tar is the built in compression abilities. But if you check out this link: http://www.miek.nl/projects/rdup/index.html it has some information on how you can use both of them.

So, either through an actual bug or just lack of documentation the tar option --incremental-backup is unreliable, however the following command uses rdup in conjunction with tar to create the desired effect.

Code:
rdup -N $DestDir/$Timestamp $DestDir/$DupInfo $Source -F "%N\n" | tar --create --files-from - --no-recursion | bzip2 > $DestDir/Backup_$Date.$Iteration.tar.bz2
Summary: "tar --listed-increment" is bad "rdup | tar --no-recursion" is good. I have attached my backup script for reference or w/e.

Update: oh no! I have tested this approach overnight and it doesn't work either, checking the rdup dumps I have found that the inode numbers have all changed. It looks as if over the course of two hours the inode numbers that rdup detects on the windows machine all change and cause a full dump.
Attached Files
File Type: txt DailyBackup.txt (2.1 KB, 11 views)
 
Old 06-18-2009, 12:50 PM   #4
orange.toaster
LQ Newbie
 
Registered: Jun 2009
Posts: 9

Original Poster
Rep: Reputation: 0
Exclamation Solved

Ok, The problem the whole time was that both rdup and tar --listed-incremental detect every file on the cifs mount as being a new file. The reason for this is that the device number would change due to the automount. Tar has an option to get around this but it wasn't doing the trick. The temporary inode numbers being given to the mounted filesystems was the cause, they were being reassigned every time they were read. To get around this mount your cifs share with the "serverino" option.

Code:
<server>:<share> <mountpoint> cifs rw,mand,credentials=<credential file>,serverino 0 0
That causes the windows machine to assign inode numbers to the files before cifs gets them, and thus they do not get reassigned. However, the windows server must support this and windows servers after 2000 do.
 
Old 06-18-2009, 08:54 PM   #5
choogendyk
Senior Member
 
Registered: Aug 2007
Location: Massachusetts, USA
Distribution: Solaris 9 & 10, Mac OS X, Ubuntu Server
Posts: 1,197

Rep: Reputation: 105Reputation: 105
Cool. You've been busy. I'm sure your effort will be appreciated by anyone who has to deal with backing up windows machines from a linux/unix backup server. I'll have to remember your solo thread next time someone with this problem asks for help.
 
  


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
using tar --listed-incremental as backup lrt Linux - Software 12 06-19-2009 07:55 AM
Incremental backup of files and directories using dump or tar peddip Linux - Server 2 02-24-2009 05:36 PM
tar --incremental OR tar --update , what to use ? crispyleif Linux - Newbie 1 02-20-2009 07:51 PM
tar --listed-incremental & filellist alexandernewald Linux - Software 0 10-31-2005 06:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:37 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