Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Jan 16, 2013, 08:57 AM   #1
sandy-locke
macrumors newbie
 
Join Date: Jan 2013
Tar do not take --exclude into account

Hi,

I'm using tar to backup my non-ios-phone onto my mac and am facing an issue with --exclude function. I enter the following line in term:

Code:
ssh developer@192.168.2.15 "tar -cvzp --exclude='/proc' --exclude='/lost+found' --exclude='/sys' --exclude='/mnt' --exclude='/media' --exclude='/dev' /" | cat > /local/path/backup.tar.gz
I also tried with "/" at the begining like this:

Code:
ssh developer@192.168.2.15 "tar -cvzp / --exclude='/proc' --exclude='/lost+found' --exclude='/sys' --exclude='/mnt' --exclude='/media' --exclude='/dev'" | cat > /local/path/backup.tar.gz
But --exclude is never taken into account and I always end up with a "short read" when "/sys" tries to tar (which is normal I assume).

Could somebody help find the right sentence please ? Thx
sandy-locke is offline   0 Reply With Quote
Old Jan 16, 2013, 12:45 PM   #2
chown33
macrumors 603
 
Join Date: Aug 2009
To make sure I understand things:
Your phone (undisclosed model and version) is running an ssh service. You're logged into that service from your Mac (also undisclosed model and OS version).

You then tell the phone to run a tar command (as posted, 2 variants), which does not correctly follow the --exclude options in that command.

The output of the remote tar command, if it worked, would be sent as standard-output to the Mac, where it's cat'ed into a Mac-local file.
If that's a correct description:

1a. Find the version of tar on the phone. If it's a version that should support --exclude, what does --help say?

1b. Try:
Code:
--exclude pattern
instead of:
Code:
--exclude=pattern
2. Make a simplified test-case of a tar command. It should contain one simple directory name (with files) and one simple exclusion (with files). It should write to phone-local storage.

3. If the simplified test-case works, create a simplified mockup directory structure that reflects the permissions and ownership of / and /sys, to test whether the problem lies with permissions or ownership.

4. Consider asking your question on a forum dedicated to your phone. The 'tar' command is running on the phone, as a phone-native process, not on the Mac. The options of a Mac-based tar (whatever version) have no relationship to the phone-based tar.
chown33 is offline   0 Reply With Quote
Old Jan 16, 2013, 01:22 PM   #3
sandy-locke
Thread Starter
macrumors newbie
 
Join Date: Jan 2013
Quote:
Originally Posted by chown33 View Post
To make sure I understand things:
Your phone (undisclosed model and version) is running an ssh service. You're logged into that service from your Mac (also undisclosed model and OS version).

You then tell the phone to run a tar command (as posted, 2 variants), which does not correctly follow the --exclude options in that command.

The output of the remote tar command, if it worked, would be sent as standard-output to the Mac, where it's cat'ed into a Mac-local file.
If that's a correct description:

1a. Find the version of tar on the phone. If it's a version that should support --exclude, what does --help say?

1b. Try:
Code:
--exclude pattern
instead of:
Code:
--exclude=pattern
2. Make a simplified test-case of a tar command. It should contain one simple directory name (with files) and one simple exclusion (with files). It should write to phone-local storage.

3. If the simplified test-case works, create a simplified mockup directory structure that reflects the permissions and ownership of / and /sys, to test whether the problem lies with permissions or ownership.

4. Consider asking your question on a forum dedicated to your phone. The 'tar' command is running on the phone, as a phone-native process, not on the Mac. The options of a Mac-based tar (whatever version) have no relationship to the phone-based tar.
Hi, thanks, yes you're correct

Phone is Nokia N9 with Meego Harmattan, Mac is MacBook Pro Late 2011 with OSX Mountain Lion.

I checked tar version and all I get is this :

Code:
BusyBox v1.20.0.git (MeeGo 3:1.20-0.2+0m8) multi-call binary.
Usage: tar -[cxtzjhmvO] [-X FILE] [-T FILE] [-f TARFILE] [-C DIR] [FILE]...
So I assume it's the tar from busybox v.1.2. for Meego.

I'll first try 1b., then 2 and post the results here. Then we'll see.

And thanks for the precision about tar being the one from the phone. I actually didn't make the correlation. I'll certainly post my question on a dedicated forum then, although since I started it up here I'll post the results of 1b and 2 here to see if it can be solved from here.
sandy-locke is offline   0 Reply With Quote
Old Jan 16, 2013, 01:39 PM   #4
chown33
macrumors 603
 
Join Date: Aug 2009
Quote:
Originally Posted by sandy-locke View Post
Code:
BusyBox v1.20.0.git (MeeGo 3:1.20-0.2+0m8) multi-call binary.
Usage: tar -[cxtzjhmvO] [-X FILE] [-T FILE] [-f TARFILE] [-C DIR] [FILE]...
So I assume it's the tar from busybox v.1.2. for Meego.
It looks like it to me.

FWIW, the -X FILE option is traditional for excluding a list in FILE. That option is supported by GNU tar and the bsdtar found on OS X Mtn Lion (see their respective man pages). The equivalent long GNU-tar option name is --exclude-from.
chown33 is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
General: How to exclude apps in iCleaner Pro Regal Jailbreaks and iOS Hacks 2 Mar 30, 2014 04:29 PM
How to exclude an SSID from iCloud Keychain JustJohnDoe OS X Mavericks (10.9) 5 Nov 13, 2013 01:26 PM
Exclude iTunes from TM Backup AppleDApp OS X 10.8 Mountain Lion 5 Nov 3, 2012 01:33 PM
Exclude signature in meil reply DubbelAdam Mac Applications and Mac App Store 5 Oct 17, 2012 08:39 AM
Time machine: How to choose instead of exclude? TijmenDal Mac Applications and Mac App Store 2 Aug 26, 2012 02:26 PM

Forum Jump

All times are GMT -5. The time now is 04:07 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC