Move files automatically?

Posted by: Dignan

Move files automatically? - 08/09/2010 18:10

I'm looking for a program that I thought for sure would exist, but I'm having difficulty tracking down.

What I want is pretty straightforward: a program that will watch a folder, and when it sees something in that folder it moves it to another folder or multiple folders.

Basically I'm looking for Dropbox for local file organization, and also I don't want to copy the files, just move them entirely.

Is there something that will do this on Windows?
Posted by: tonyc

Re: Move files automatically? - 08/09/2010 18:16

How does this folder-watching program know that the program that created the files is done writing to them?
Posted by: larry818

Re: Move files automatically? - 08/09/2010 18:20

Just creating a shortcut to that folder won't work? I'm assuming you want the folder always empty?
Posted by: Dignan

Re: Move files automatically? - 08/09/2010 19:03

Originally Posted By: tonyc
How does this folder-watching program know that the program that created the files is done writing to them?

That's an excellent question, and I was thinking the same thing, but I assume that it wouldn't be a problem. How does a program like Dropbox know the same thing?

Originally Posted By: larry818
Just creating a shortcut to that folder won't work? I'm assuming you want the folder always empty?

Exactly. I need the files moved completely.
Posted by: drakino

Re: Move files automatically? - 08/09/2010 19:09

robocopy.exe /mov /mot (or possibly /mon depending on your needs)
Posted by: hybrid8

Re: Move files automatically? - 08/09/2010 21:02

There are definitely a number of programs out there for Windows that watch folders for you and can then run arbitrary commands/scripts on the files that appear - after they've been written. Such as DirMon

When a file is being written it'll be locked by the program doing the writing, will it not? When that lock has been released, it's ready to go. In any case, plenty of software supports this kind of file monitoring feature, so it's probably something pretty straight forward on the OSes that they're written for.
Posted by: Shonky

Re: Move files automatically? - 08/09/2010 23:15

At its simplest, a scheduled batch file running

move x:\file\location\*.* y:\new\location

If the file is still open and locked it will just fail and try it again next time. You have to assume that whatever creates the file has exactly one chance of writing it. As soon as it closes it and loses the lock, it's fair game.
Posted by: siberia37

Re: Move files automatically? - 09/09/2010 23:42

A program could be written to do that- but the question is exactly why? Basically what you want is a folder where anything that is written there gets moved (not copied) somewhere else. Err.. why not just write the file in that target folder to begin with?
Then you mention that you want the program to possibly move to multiple folders- well that's not a move then that's a copy.
I could see if you wanted a program where based on the filename or attributes it would move to different folders, but to move every single file seems kind of useless to me.
Posted by: gbeer

Re: Move files automatically? - 10/09/2010 00:28

The folder in question might be a drop box. Let stuff in but make it unavailable as soon as practical.
Posted by: wfaulk

Re: Move files automatically? - 10/09/2010 12:40

That's more easily solved with permissions. Most filesystems will allow writes without reads.
Posted by: canuckInOR

Re: Move files automatically? - 10/09/2010 15:04

Originally Posted By: siberia37
A program could be written to do that- but the question is exactly why? Basically what you want is a folder where anything that is written there gets moved (not copied) somewhere else. Err.. why not just write the file in that target folder to begin with?
Then you mention that you want the program to possibly move to multiple folders- well that's not a move then that's a copy.
I could see if you wanted a program where based on the filename or attributes it would move to different folders, but to move every single file seems kind of useless to me.

The simple answer is that he's probably working with something he doesn't get to control. For example whatever is putting files in the directory may be configured to always write files into that particular location, or may not have the flexibility to write files into different locations or write multiple copies into multiple locations.

Or, it could be a drop-box scenario, where the drop-box is a publicly accessible directory that's screened off to prevent people from wandering around in the system (a common technique for FTP drops), but the eventual destination of the files is somewhere else, so you have a background process with more permissions move things into the desired location.

Lots of reasons for wanting a program like this...
Posted by: Dignan

Re: Move files automatically? - 17/09/2010 18:44

Okay, now that I'm in need of it, here's the use case:

My wife and I have separate computers and separate photo collections, but we just bought a camera and we want the photos from it to be on both of our systems.

I've purchased an Eye-Fi for the new camera. If you aren't familiar with Eye-Fi, it's a great little device. It's an SD card that can transfer your photos over to your computer wirelessly when it sees your home network. It'll automatically move the photos over and sort them into folders.

But this can only be installed on one computer at a time. What I need is to be able to then have those files copied to another computer on the network. Naturally, I could do this manually, but I'd like to be able to do it automatically.

Is that possible?
Posted by: drakino

Re: Move files automatically? - 17/09/2010 18:56

See my robocopy post above. It's built in on Vista and 7, just set it up as a startup task or something. /mov is "move files" and it has a ton of other options to do exactly what you want. /mon tells it to monitor a folder and do the move/copy again after X changes (user configurable), or mot (X time).
Posted by: Dignan

Re: Move files automatically? - 17/09/2010 19:16

Okay, I'll experiment with that and see if it does what I need. Thanks!

*edit*

But wait, how do I give it the rest of the information, like which folder to monitor and which folder to move to?
Posted by: drakino

Re: Move files automatically? - 17/09/2010 19:53

Open a command prompt and type "powershell /?"

It's going to product a very long help list, as it does have a ton of options. It's worth scanning them all, to see what might be useful for your exact setup. There are a number of Robocopy GUIs, but most just spam out the same list of options with checkboxes.
Posted by: hybrid8

Re: Move files automatically? - 17/09/2010 20:19

Or just use the program I linked to - it's super simple.
Posted by: tanstaafl.

Re: Move files automatically? - 17/09/2010 21:15

Originally Posted By: Dignan

But wait, how do I give it the rest of the information, like which folder to monitor and which folder to move to?
Couldn't you just download the pictures from your cameras always onto one computer, then every once in a while use a backup program to do a limited backup across the network? The backup program will have its own scheduler built in, and you can specify the source and destination paths in as much detail as you want.

Since this seems like a simple solution, no doubt I am misunderstanding what it is you are trying to do. smile

tanstaafl.
Posted by: pca

Re: Move files automatically? - 18/09/2010 01:40

Hi.

You may find that PureSync does what you want. I use it to mirror my working directory structure on my main windows box across the network to the linux fileserver, and from there to the laptop. It also handles replicating copies of the acronis backup files. It took a little while to set up, but works completely reliably in the background.

You can set it to monitor a specific directory for changes, and after a period of time since the last change, make the copy. It has a lot of other options and modes as well.

pca
Posted by: Taym

Re: Move files automatically? - 18/09/2010 15:21

Originally Posted By: Dignan
But wait, how do I give it the rest of the information, like which folder to monitor and which folder to move to?


robocopy will do that. Just look at the help (robocopy /?).
I too use robocopy for my daily backup. I've done so for years and it just works.
Posted by: JBjorgen

Re: Move files automatically? - 20/09/2010 03:27

If you're like me and already familiar with rsync, cwRsync might be what you're looking for. Works great for me.
Posted by: tahir

Re: Move files automatically? - 20/09/2010 13:30

I'd use Replicator from karenware.com, unbelievably easy to use and plenty of options.

I've been using it for years.
Posted by: tanstaafl.

Re: Move files automatically? - 20/09/2010 22:59

Originally Posted By: tahir
I've been using it for years.
And here I thought I was the only oddball geek using that. I've used it for the last five years or so and have been quite pleased with it.

tanstaafl.
Posted by: tahir

Re: Move files automatically? - 21/09/2010 11:47

Originally Posted By: tanstaafl.
I thought I was the only oddball geek using that.


Heh smile

It's just sooo simple, only had one issue; when I first started backing up my MP3s I had a MAJOR accident, I'd set the job in the wrong direction (from empty drive to live drive) and I had delete non existent files checked! I lost 1000+ ripped CDs (2 years to rip), just like that. That's when I changed to Audiograbber from whatever the Xing ripper was called. I didn't even have a means of playing them back at that stage.

Wonder how long ago that was?
Posted by: tanstaafl.

Re: Move files automatically? - 21/09/2010 19:51

Originally Posted By: tahir
I lost 1000+ ripped CDs (2 years to rip), just like that.

You weren't able to restore the data with something like Recuva?

I did something similar but not with Replicator, I was erasing an external USB drive preparatory to using Replicator to copy an internal drive to it, and somehow erased the internal (source) drive instead, Shift-Del on the root folder! Recuva brought all the data back except for one photograph. Don't know why it didn't get that.

tanstaafl.
Posted by: tahir

Re: Move files automatically? - 22/09/2010 08:43

Originally Posted By: tanstaafl.
I did something similar but not with Replicator, I was erasing an external USB drive preparatory to using Replicator to copy an internal drive to it, and somehow erased the internal (source) drive instead, Shift-Del on the root folder! Recuva brought all the data back except for one photograph. Don't know why it didn't get that.


Glad to know I'm not the only one! Unfortunately it was a while before I realised what I'd done, I tried various undelete utilities with varying degrees of success. But by then I'd also realised that encoding at 128k was not a good idea so started re-ripping anyway.
Posted by: gbeer

Re: Move files automatically? - 22/09/2010 23:05

Windows has a way to make a mapped network share work offline.
The files are copied to the local machine and may be synchronized, either manually or on a schedule.

No need for any additional software.