LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 09-03-2009, 05:13 AM   #1
Thymox
Senior Member
 
Registered: Apr 2001
Location: Plymouth, England.
Distribution: Mostly Debian based systems
Posts: 4,368

Rep: Reputation: 63
file name too long to be stored in a GNU multivolume header


Hi all,

A quick script to backup one of our servers - it uses tar and splits the tar file into multiple files of a known size. Unfortunately, it would seem that tar (when using the GNU format) doesn't support long file/directory paths in a multi-volume header.

The heart of the script is noted below:
Code:
  tar \
    --files-from=$strINCLUDE \
    --exclude-from=$strEXCLUDE \
    --recursion \
    --create \
    --file $strBACKUPLOCATION/backup \
    --multi-volume \
    --tape-length $strSIZE \
    --format=gnu \
    --new-volume-script $strBACKUPLOCATION/post_tar_script.sh
Where am I going wrong? If I set --format=pax then it fails completely complaining of incompatible features.

Grant.
 
Old 09-04-2009, 04:55 AM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981
Odd! From the GNU tar manual:
Quote:
Archives in ‘gnu’ format are able to hold file names of unlimited length.
regardless of being a multi- or single volume. Please, can you post the exact message you get? I suspect the massage comes from the post-processing script (post_tar_script.sh) instead.

Last edited by colucix; 09-04-2009 at 04:59 AM.
 
Old 09-05-2009, 05:49 PM   #3
Thymox
Senior Member
 
Registered: Apr 2001
Location: Plymouth, England.
Distribution: Mostly Debian based systems
Posts: 4,368

Original Poster
Rep: Reputation: 63
The title of the thread is the exact error message.

The job is run at 1am by a cron entry. The cron entry does not redirect stdout nor stderr to /dev/null (purposefully, so we get mailed the results). The mail is as follows:
Code:
tar: Removing leading `/' from member names
tar: /var/run/dbus/system_bus_socket: socket ignored
tar: /var/run/acpid.socket: socket ignored
tar: /var/run/fpcgisock: socket ignored
tar: Removing leading `/' from hard link targets
tar: var/qmail/mailnames/blahblahblah: file name too long to be stored in a GNU multivolume header
tar: Error is not recoverable: exiting now
The post_tar script is as follows:
Code:
#!/bin/sh
strBACKUPLOCATION=/var/backups

. $strBACKUPLOCATION/variables

echo $strNEWCOUNT > $strBACKUPLOCATION/count
# Renames the "backup" file to "backup.date.count"
mv $strBACKUPLOCATION/backup $strBACKUPLOCATION/$strFILENAME

# BZip2 file, consequently renaming as backup.date.count.bz1
#bzip2 --compress --fast $strBACKUPLOCATION/$strFILENAME
#strFILENAME=$strFILENAME&".bz2"

# Find size of file and add it to textfile
strSIZEOFFILE=`ls -l $strBACKUPLOCATION/$strFILENAME | awk '{print $5}'`
echo $strSIZEOFFILE $strFILENAME >> $strBACKUPLOCATION/filesizes.list
echo . >> $strBACKUPLOCATION/filesizes.list

lftp -c "open $strHOST -e 'put $strFILENAME -o $strDAY/$strFILENAME' -u $strUSER,$strPASSWD"

# FTP the file to FTP server
#ftp -n $strHOST <<END_SCRIPT
#quote USER $strUSER
#quote PASS $strPASSWD
#quote put $strFILENAME $strDAY/$strFILENAME
#quit
#END_SCRIPT

# Move file to "ftped" folder.
rm -f $strBACKUPLOCATION/$strFILENAME
Not exactly a clean bit of code, but it works.
 
Old 09-06-2009, 02:23 AM   #4
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981
I glanced through the tar source code and found this, as a comment inside the block of code that writes the multi-volume header:
Code:
/* FIXME: Michael P Urban writes: [a long name file] is being written
   when a new volume rolls around [...]  Looks like the wrong value is
   being preserved in real_s_name, though.  */
As you can see, it looks like an open bug. The comment above comes from the latest sources, version 1.22. I'd give the latest release a chance, anyway.
 
Old 09-07-2009, 04:48 AM   #5
Thymox
Senior Member
 
Registered: Apr 2001
Location: Plymouth, England.
Distribution: Mostly Debian based systems
Posts: 4,368

Original Poster
Rep: Reputation: 63
Ouchy! We're still on tar v.1.15.1. FC4 server that's badly in need of updating but we can't really afford to take various services off-line.

Thank you.
 
Old 11-11-2017, 03:00 PM   #6
swilsy
Member
 
Registered: May 2012
Distribution: Ubuntu Server 16.04/Lubuntu 18.04
Posts: 36

Rep: Reputation: Disabled
Still no fix?

I did not want to duplicate this thread, so I am posting here. I am running into the same issue. I am trying create multiple 1TB .tar files as part of a backup routine using the -M option with the tar utility.

My tar command looks like this:
Code:
tar -cM --file=Backup_A.tar --file=Backup_B.tar --file=Backup_C.tar --file=Backup_D.tar --file=Backup_E.tar --file=Backup_F.tar --file=Backup_G.tar --file=Backup_H.tar --tape-length=1T /DirToBackup
When tar got to the end of the first 1TB .tar file, it through out a message that said
Code:
:file name too long to be stored in a gnu multi volume header, truncated
after the name of file with a really long path. Based on some quick research, this seems to only be an issue when a file with a long path is straddling two archive files. This looks like the same bug referenced in this original post. Is there any work around or solution for this issue?

Tar version is 1.28. Running Ubuntu Server 16.04.

Last edited by swilsy; 11-12-2017 at 10:31 AM.
 
  


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
what file(s) are hotkeys stored in? newbiesforever Linux - General 8 09-09-2008 03:04 PM
Where are stored executable file stefane321 SUSE / openSUSE 1 09-24-2007 02:51 PM
what file are routes stored in? hcclnoodles Solaris / OpenSolaris 6 10-04-2006 03:46 PM
How to file stored in C:\ using windows abbhatt Linux - Software 3 12-26-2005 11:33 AM
GNU libc installation to setup cross compiler env - kernel header file TOO OLD !! tanch00 Linux - Software 1 02-06-2002 03:33 AM

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

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