# I'm panicked!



## tajudd (Mar 15, 2011)

OK, I think I pinpointed why this migration should be on my failblog.  I wasn't thinking of naming conventions but rather just the work that needs to be done.  Here's my problem..

I'm trying to bring several GB of email archives (from an IMAP server) over.  The source server has a *LOT* of files and directories already named beginning with a "." dot.  Tar seems to be ignoring anything that begins with a dot, what other tools (aside from [CMD=""]find ./ | tar @-[/CMD] if that works) can I bring dotfiles over with?  quick read of the manpage didn't result into anything that seemed to answer this.

I'll continue to search, but thought asking here would benefit others too..


thanks loads, everyone.


----------



## wblock@ (Mar 15, 2011)

Not clear exactly how you're using tar.  Maybe you just need .* in addition to * for filenames?

net/rsync with the -aH option, maybe.  If the files are most of a partition, dump(8)/restore(8).


----------



## Galactic_Dominator (Mar 16, 2011)

tar picks up my . leading files and directories just fine.


----------



## wblock@ (Mar 16, 2011)

Not here:

```
% mkdir /tmp/zoot
% cd /tmp/zoot
% touch .a .b c d e f
% tar cvf zoot.tar *
a c
a d
a e
a f
% tar tvf zoot.tar
-rw-r--r--  0 wblock wheel       0 Mar 15 20:35 c
-rw-r--r--  0 wblock wheel       0 Mar 15 20:35 d
-rw-r--r--  0 wblock wheel       0 Mar 15 20:35 e
-rw-r--r--  0 wblock wheel       0 Mar 15 20:35 f
```

Incidentally, using '.*' as I suggested above is a mistake.  Sorry about that.


----------



## sixtydoses (Mar 16, 2011)

tar picks up dot files just fine here, using '.*'.


```
$ ls -a 
.  .. .a .b .c d  e  f
$ tar cvfz dot.tgz .* 
a .a
a .b
a .c
$ tar tvfz dot.tgz 
-rw-r--r--  0 dot    dot         0 Mar 16 11:09 .a
-rw-r--r--  0 dot    dot         0 Mar 16 11:09 .b
-rw-r--r--  0 dot    dot         0 Mar 16 11:09 .c
```


----------



## Galactic_Dominator (Mar 16, 2011)

Change
`% tar cvf zoot.tar *`
to
`% tar cvf ../zoot.tar /tmp/zoot/`
or 
`% tar cvf ../zoot.tar .`


----------



## wblock@ (Mar 16, 2011)

sixtydoses said:
			
		

> tar picks up dot files just fine here, using '.*'.



Oh yes, it picks them up.  But .. is one of them.  And so it includes the parent directory also.


----------



## wblock@ (Mar 16, 2011)

Galactic_Dominator said:
			
		

> Change
> `% tar cvf zoot.tar *`
> to
> `% tar cvf ../zoot.tar /tmp/zoot/`
> ...



Aha!  Refer to the directory instead of a wildcard that automatically hides dotfiles.


----------



## sixtydoses (Mar 16, 2011)

wblock said:
			
		

> Oh yes, it picks them up.  But .. is one of them.  And so it includes the parent directory also.



No, parent directory isn't included.


----------



## wblock@ (Mar 16, 2011)

Parent is included here (8.2-STABLE):

```
% pwd
/tmp/zoot/zootinner
% tar cvf /tmp/zoot.tar .* *
a .
a ./.a
a ./.b
a ./c
a ./d
a ./e
a ..
a ../tinycore_3.4.iso
a ../zootinner
a ../zootinner/.a
a ../zootinner/.b
a ../zootinner/c
a ../zootinner/d
a ../zootinner/e
a .a
a .b
a c
a d
a e
```


----------



## Galactic_Dominator (Mar 16, 2011)

`% tar cvf zoot.tar .[^.]* *`


----------



## sixtydoses (Mar 16, 2011)

Hmm.

8.2-RELEASE

```
$ tar cvf /tmp/dot.tar .* *
a .a
a .b
a .c
a d
a e
a f
$ tar tvf /tmp/dot.tar
-rw-r--r--  0 dot    dot         0 Mar 16 11:09 .a
-rw-r--r--  0 dot    dot         0 Mar 16 11:09 .b
-rw-r--r--  0 dot    dot         0 Mar 16 11:09 .c
-rw-r--r--  0 dot    dot         0 Mar 16 11:09 d
-rw-r--r--  0 dot    dot         0 Mar 16 11:09 e
-rw-r--r--  0 dot    dot         0 Mar 16 11:09 f
```


9.0-CURRENT

```
$ tar cvf /tmp/dot.tar .* *
a .a
a .b
a .c
a d
a e
a f
$ tar tvf /tmp/dot.tar
-rw-r--r--  0 dot   dot        0 Mar 16 13:02 .a
-rw-r--r--  0 dot   dot        0 Mar 16 13:02 .b
-rw-r--r--  0 dot   dot        0 Mar 16 13:02 .c
-rw-r--r--  0 dot   dot        0 Mar 16 13:02 d
-rw-r--r--  0 dot   dot        0 Mar 16 13:02 e
-rw-r--r--  0 dot   dot        0 Mar 16 13:02 f
```


----------



## Galactic_Dominator (Mar 16, 2011)

sixtydoses said:
			
		

> No, parent directory isn't included.


depends on $SHELL globbing


----------



## DutchDaemon (Mar 16, 2011)

I hope OP hasn't fled the country.


----------



## tajudd (Apr 2, 2011)

No, didn't fled the country -- I couldn't track what the problem was, but tar missed some files when creating the archive (might I add a Dell server -- I've come to hate Dell) and cpio missed other files when creating it's archive.

between tar and cpio, I got everything across.  Tar was not missing dotfiles, I can't pin down why it was missing.


Anyway, that issue got resolved -- I started this thread in a panic and forgot about it -- apologies to all.


----------

