On Friday 29 June 2001 21:14, Nitin Kumar Gupta wrote:
> Hi,
>
> On Fri, 29 Jun 2001, Faisal wrote:
> > # (cd /source_dir; tar -cf - *)|(cd /target; tar -xf - )
> >
> > It effectively tars the source directory contents to stdout and then
> > untars it in the target directory. Beware tho' that if you have any
> > hidden (read .dot files) you'll miss it because of the '*'
>
> I think this will take care of dot files also:
> # (cd /source_dir;cd ..; tar -cf - source_dir)|(cd /target_dir;cd ..; tar
> -xf -)
>
> Basically, instead of going into the directory, just remain one level up.
But then you end up with the source_dir lying in the parent of target_dir. My
intension was something like having to move the /usr or something to
/new_user.
Anyway, an easier way to state the same thing would be:
(cd /source_dir/..; tar -cf source_dir)|(cd /target_dir; tar -xf -)
Hmm... Maybe this will work better...
(cd /source_dir; find -maxdepth 1 | grep -v '^\.$' | xargs tar -cf - )|(cd
/target_dir; tar -xf -)
Another tip - If you intend to move your / to somewhere else - completely, if
you're not careful, you'll end up in a loop - because a tar of the / to
somewhere else will include the target as well...
What I normally do to move / is:
1. Mecome single user - init 1
2. unmount everything possible. - proc etc.
3. ls / > /files
4. edit /files and remove anything that isn't to be moved - like a mounted
/usr or the new / mount point.
5. (cd /; tar -cf - `cat /files` )|(cd /new_root; tar -xf -)
Hmmm... I guess there are a lot of ways of doing this. This is just how I do
it normally. (Yep ! Like I normally keep giving my / some exercise :)
cheers,
Faisal.
--
-====----====----====----====----====----====----====---
"If all else fails, read the manual."
-Unknown
-====----====----====----====----====----====----====---
_______________________________________________
linux-india-help mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/linux-india-help