Move file from multiple sub directories to single folder

Started by champs777, November 05, 2014, 02:41:57 AM

Previous topic - Next topic

champs777

First of all, love the application.  You really did a great job!

I have a folder:
/photos/2014

Inside this folder is many different directories that contain both .jpg and .mov files.  I want to scan all directories under /photos/2014.  I want to move any file with a .mov extension into another folder called /movies.

I have the source set right
I have the files to copy, with the included files "*.mov" working
Destination is working
Copy mode is move

The only issue I am having is that even if there isn't any "*.mov" files in a sub directory, it is still wanting to create an empty sub directory.  Here is a screen shot.
http://i.imgur.com/AMGC27r.png

In addition, I would really like only the "*.mov" files to be moved, and not the sub directory.

Example

To start I would have this:
/photos/2014/testa
-- 123.jpg
-- 234.jpg
-- abc.mov

/photos/2014/testb
-- 345.jpg
-- 456.jpg

/photos/2014/testc
-- bcd.mov
-- abc.mov

Would look like this when done:

/photos/2014/testa
-- 123.jpg
-- 234.jpg

/photos/2014/testb
-- 345.jpg
-- 456.jpg

/photos/2014/testc

==========
/movies
-- abc.mov
-- bcd.mov
-- abc.mov

Thanks again for an amazing product!  Really amazing work!

Richard Moss

Hello,

Thanks for your comments.

Not sure why it's wanting to create empty folders when if it's not going to copy/move any files - that's almost certainly a bug. Which I've now logged :)

In regards to "flattening" folder hierarchies when copying, hadn't really considered that. But it seems reasonable enough so I'll log that as enhancement.

Hopefully both of these will be in the next update

Thanks again for the feedback!

Regards;
Richard Moss

champs777

Quote from: Richard Moss on November 05, 2014, 04:36:20 PM
Hello,

Thanks for your comments.

Not sure why it's wanting to create empty folders when if it's not going to copy/move any files - that's almost certainly a bug. Which I've now logged :)

In regards to "flattening" folder hierarchies when copying, hadn't really considered that. But it seems reasonable enough so I'll log that as enhancement.

Hopefully both of these will be in the next update

Thanks again for the feedback!

Regards;
Richard Moss

If easier, you wouldn't even have to flatten, as long as you only copied the directories with matching criteria.

/movies/testa
-- abc.mov

/movies/testb
-- bcd.mov
-- abc.mov

I use this on a media server and I was looking for an application that will allow me to copy, move, delete files on a scheduled basis.  I have found many applications that allow you to do this, but none, that allow a different schedule for each profile/job.  That is huge and super helpful!

Let me know if you need any logs or any additional information.  Thank you again for the quick reply. I am really digging the application a ton.  you did really...really nice work.

I have another question but I will open a new thread. =)

Richard Moss

Quote from: champs777 on November 05, 2014, 04:46:37 PM
I have another question but I will open a new thread. =)
New threads and questions are what these forums are for ;)

Richard Moss

#4
Turns out at some point a "Copy Empty Folders" has already been added. Can you give this a whirl and see if it solves the first of your problems. (It's in the Copy Mode tab, Advanced Options hyperlink).

In regards to flattening destination folder hierarchies, I've implemented this, but I'm not too happy with it as it's quite easy for files to be lost. For example, if you have

/photos/2014/testb
-- 1.jpg
-- 2.jpg

/photos/2014/testc
-- 1.jpg
-- 3.jpg


then there's a problem - two folders contain 1.jpg. Both of these will be picked up as copy/move actions, but it's a case of the last one wins, whichever was copied first is going to be lost. And I don't like that behaviour.

champs777

Quote from: Richard Moss on November 11, 2014, 06:08:59 PM
Turns out at some point a "Copy Empty Folders" has already been added. Can you give this a whirl and see if it solves the first of your problems. (It's in the Copy Mode tab, Advanced Options hyperlink).
Right now I have this option disabled. Here is a screen shot
http://i.imgur.com/CUzdgcK.png

If this is disabled, it shouldn't copy over folders with nothing in it correct? 

When i previewed the profile, this is what I got.  It looked like it was going to create empty directories, but I ran it just in case:
http://i.imgur.com/b9TUdS7.png

Here was the result.  It did create empty directories even with the "Copy Empty Folders" unchecked.
http://i.imgur.com/b9TUdS7.png

Quote from: Richard Moss on November 11, 2014, 06:08:59 PM
In regards to flattening destination folder hierarchies, I've implemented this, but I'm not too happy with it as it's quite easy for files to be lost. For example, if you have

/photos/2014/testb
-- 1.jpg
-- 2.jpg

/photos/2014/testc
-- 1.jpg
-- 3.jpg


then there's a problem - two folders contain 1.jpg. Both of these will be picked up as copy/move actions, but it's a case of the last one wins, whichever was copied first is going to be lost. And I don't like that behaviour.

Yeah.  You are right.  That is concerning.  I thought about that as well.  In my case, I can 100% guarantee  uniqueness.  I can think of 2 possible ways to prevent/help this.
1) If a match, append a random number, date/time stamp etc.  This will prevent the override.
2) allow the user to select to auto-override. 

Richard Moss

Hmm. Looks like a bug then - I'll do some more digging. At first glance the code looked OK, but there isn't an explicit test for that flag and so there's probably something daft somewhere breaking it. Will write a test and work out what's wrong, then stick that in the next update too :)

Richard Moss

Confirmed a bug with the empty folder stuff. If the source folder has any files and the destination folder doesn't exist, then a create folder action will be generated even if all the source files are excluded from the copy. Easy enough to resolve, will be in the next update!