Incremental tar won't work

jyhm

Ultra Geek
Hello Guru's

Once agin I have come for your wisdom and seek an answer that is not known to me. I am tring to create a back_up script that incrementally backs up a directory. Below is the code I am using in bash.

Code:
find Directory/Path -mtime -1 -type f -print | tar -cvzf tar_ball.tar.gz -T - 2> Documents/Plan_B/logs/$this_day.log

However, I get this error log on output, and I get a blank file called -T in my home dorectory.

Code:
tar: Unable to access - <No such file or directory>
tar: WARNING! These file names were not selected:
-

This is the syntax that is used for incremental back_ups, throughout most of the tutorials that I have read.

Please Help,

jyhm
 
Yes, the one after... what is that "2" doing in front of the redirection? I don't think that's legal syntax...

Also, what are you using in place of "Directory/Path"? Is it a valid directory?
 
Check the tar manpage in OS X - the usage for tar could well be different from the one in Linux. In fact, if it's the tar from FreeBSD, then it's probably not gnutar, which would almost certainly mean the syntax would have some subtle differences (gnu utilities, generally speaking, have screwy syntax that doesn't jive well with the non-gnu versions)
 
You 2> guys are great! You helped me out the last time!

The 2> is a valid file descriptor redirect in bash as I have since learned in this fine forum (see the link below). The directory I am using is Desktop/jyhm/ and it is valid.

http://www.luv.asn.au/overheads/bash.html#redirecting

Check the tar manpage in OS X - the usage for tar could well be different from the one in Linux...

A note to Scruffy,
When checking for a version of tar, I get the proceeding error message;

Code:
bash-2.05a$ tar --version
tar: Failed open to read on /dev/nrst0 <No such file or directory>

I tried installing the latest version of tar but I am lost as to how to do it, any advice Comrad?

jyhm
 
Back
Top