3

I would like to find the command that copy my eclipse options to another workspace:

/home/me/myWorkspace/.metadata/.plugins/org.eclipse.core.runtime/*

There is only one directory org.eclipse.core.runtime among many to copy into a new workspace preserving the structure .metadata/.plugins/. After copy the structure should be:

/destination/path/newWorkspace/.metadata/.plugins/org.eclipse.core.runtime/

without manually create .metadata/.plugins/

[~]$ cd /home/me/myWorkspace/
[myWorkspace]$ cp -Rf .metadata/.plugins/org.eclipse.core.runtime -t /destination/path/newWorkspace/.metadata/.plugins
cp: can't create directory '/destination/path/newWorkspace/.metadata/.plugin': No such file or directory  

It doesn't work, and it could be source of error to write the path .metadata/.plugins manually. It certainly a better idea to create a complete script ?

3
  • What error message did you get? Jul 20 '11 at 16:22
  • You need to create /dest/path/newWorkspace/.metadata/.plugins/ if this directory does not exist. You can't copy to a destination that does not exist, otherwise the command you entered should copy the dir to destination exactly as you want.
    – Nicholi
    Jul 20 '11 at 20:16
  • I can create the directory with mkdir -p /destination/pat/newWorkspace/.metadata/.plugins but it could be source of error.
    – chepseskaf
    Jul 21 '11 at 6:46
1

I think you are looking for something like:

cd /home/me/myWorkspace
cp -Rf --parents .metadata/.plugins/org.eclipse.core.runtime /destination/path/newWorkspace
1
  • Thanks it does the trick (I've allowed myself to correct the command line about my problem)
    – chepseskaf
    Jul 21 '11 at 7:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.