Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Jolly Roger Newsgroups: comp.sys.mac.apps Subject: Re: tar: Pathname too long Date: 5 Oct 2016 18:56:57 GMT Organization: People for the Ethical Treatment of Pirates Lines: 44 Message-ID: References: X-Trace: individual.net J07gK1XQ2fyP+VWDiI+brAAPhgpeuOLvBtJXSQvzvZLGCFMJEG Cancel-Lock: sha1:S9L39vRxHSSC0axe66hSv7Qm+gc= Mail-Copies-To: nobody User-Agent: slrn/1.0.1 (Darwin) Xref: csiph.com comp.sys.mac.apps:36678 On 2016-10-05, Robert Peirce wrote: > On 10/5/16 10:46 AM, Robert Peirce wrote: >> Okay. I've been here before but the problem still exists and I don't >> know why. Doe anybody have a suggestion to get around this problem? >> >> >> Here is one of the output lines: >> >> tar: ./Podcasts/Reason Podcast/Richard Epstein_ Why Obamacare Is >> Collapsing and He's Not Voting for Trump, Hillary, _or_ Johnson.mp3: >> Pathname too long >> >> Last time everybody agreed that there is no such thing as a too long >> pathname in tar itself so I thought maybe there is something in the >> command line doing it. Tar is a symbolic link to bsdtar, and bsdtar is >> timestamped 03/12/16. >> >> In this line TS is a timestamp file updated after each backup. If the >> problem is not in tar (bsdtar), find or exec could be causing it. >> >> find . -type f -mnewer ../TS -exec tar -rf ~/media.t {} \; > > The problem seems to be the "-type f" argument. Without that it works. > With it it fails. Why? These file names are extremely long, right? Maybe the entire command line, including that argument, is too long. What happens if you remove the "-type f" argument, but add another of similar length, like "-print0"? If that also fails, then you're probably dealing with a shell command line length issue. If so, you may want to try using xargs rather than the -exec switch. > I would still like to know why this doesn't work as expected and any way > to work around it. Welcome to shell hell. Rewrite the script in something higher level like PHP, Ruby, etc, and my bet is this issue will simply vanish into thin air. -- E-mail sent to this address may be devoured by my ravenous SPAM filter. I often ignore posts from Google. Use a real news client instead. JR