Author Topic: mass moving of files(placed in different directories)  (Read 3872 times)

johanr

  • Veteran
  • ***
  • Posts: 144
    • View Profile
mass moving of files(placed in different directories)
« on: October 20, 2008, 10:31:43 pm »
Hello again

Here I am again with yet another noob question.
I updated the screensaver a few days ago and I was Very lazy. Basically I added all the folders with pics and videos (synced from my N95)
What I didn't think of what that LMCE would read all the files and show the video files in the Video view in the orbiter.Very nice feature!! but this time I felt more like.
 Oh! no... crap!.. (there are like 20 clips)

So, before I start going in and out of each directory moving the video clips to one Directory one by one.
Checked the man find but could not see anything like this so I guess there have to be another type of command if it exists (Linux I have learned is full of nice commands and options to those)

Is there a way of doing an advanced find or similar, like

Find *.MP4 move to / whatever / wanted / as / directory /


 :-\


Best Reg.
Johan

colinjones

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 3003
    • View Profile
Re: mass moving of files(placed in different directories)
« Reply #1 on: October 21, 2008, 12:05:23 am »
Try

sudo find /home/public -name "*.mp4" -exec mv '{}' /<dir> \;

Change the <dir> in bold to where you want the files to end up. Also, be aware that by default Find will not follow symlinks so this will only work on content local to the core, you need to add another option to allow it to follow links out to your network storage.

Finally, I would strongly encourage you to make /home/public more specific. Not sure where you are moving from and to, but you need to ensure that there is no chance that find will search/recurse into the destination otherwise it will find files again that it has already moved and try to move them again to the same spot!

Oh, and for tidiness, you really should go back with the web admin at a later point and clean up the metadata...

johanr

  • Veteran
  • ***
  • Posts: 144
    • View Profile
Re: mass moving of files(placed in different directories)
« Reply #2 on: October 21, 2008, 11:04:06 am »
wow! thanks.. will give it a try. That command I would never have figured out myself..

 hmm.. maybe for that continous moving of file(loop) I can rename the destination files(?)

So far I am only moving it on the same hdd.
 By Metafiles you mean do a resync I guess?

-johan

colinjones

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 3003
    • View Profile
Re: mass moving of files(placed in different directories)
« Reply #3 on: October 21, 2008, 03:17:21 pm »
Try

man find

Will give you all the details you need on how to modify the options. For the loop, just make sure that the destination you are moving to isn't under the source anywhere.

Metadata is in the database, yes (the attributes etc), but resync won't get rid of metadata for files that have been deleted (LMCE will see the moved files as "missing" ie deleted). It hides "deleted" files, but for tidiness I often manually delete them in the Sync screen (there is a check box to display files missing from disk.)

johanr

  • Veteran
  • ***
  • Posts: 144
    • View Profile
Re: mass moving of files(placed in different directories)
« Reply #4 on: October 21, 2008, 04:24:47 pm »
did that before and during the troubleshooting of the command you suggested.
It seem it wanted me to give a dest filename, because it complained that "no such file or directory"
Tried alot of different ways, like just doing a sudo find trying to see whether my path defined was bogus or something.
Anyway I ended up thinking Hey!.. what about Dolphin.

Went to Doplhin file mgr and made a search there, then took the files that it found and copied them to the directory I wanted.
Voila!
then back again and deleted the original files.
Will now make a file sync in Admin.

Off course it will show the files still but now the files are in the same place..

Is it any way of saving the "view" in the orbiter? For example when choosing to filter only dvd movies I would like it to show only dvd's (remembering my selection) the next time I enter.

Br
Johan

skeptic

  • Addicted
  • *
  • Posts: 615
    • View Profile
Re: mass moving of files(placed in different directories)
« Reply #5 on: October 21, 2008, 11:37:01 pm »
Is it any way of saving the "view" in the orbiter? For example when choosing to filter only dvd movies I would like it to show only dvd's (remembering my selection) the next time I enter.

Br
Johan
I asked this a week or so ago, sort answer appears to be no.  A lot going on behind the scenes making this a less than trivial task.

johanr

  • Veteran
  • ***
  • Posts: 144
    • View Profile
Re: mass moving of files(placed in different directories)
« Reply #6 on: October 22, 2008, 09:24:24 pm »
ok. Fair enough, doesn't fell like a major obstacle.

 Then I may have to figure something else out. Maybe putting it on a disk or users dir, that is not listed in public. Because in the Main view it felt like "it" remembers the choices made. At least on the on-screen orbiter and the web orbiter.
Hmm..

Let me know if you figure something out to get around it.


-johan
notice how I start to talk about LMCE as It.. soon I guess I will call It Her and then Sarah and then my wife will start to ask questions..  ;D

canzi

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: mass moving of files(placed in different directories)
« Reply #7 on: November 07, 2008, 06:48:27 am »
Hi All

another Brisbane user here
nice to meet you all

hope to add my 2 cents worth

Steve