How to automatically duplicate copy contents of one folder to another folder on a different disk?

StackOverflow https://stackoverflow.com/questions/18220680

  •  24-06-2022
  •  | 
  •  

Pergunta

I have a folder in im c:/ drive (lets say C:\users\myname\python). Every time I create new files in that directory, is it possible to have those files automatically copy to a folder on my d: disk (d:\"magic briefcase").

The main reason I want to so this is that on my d: disk I have the "magic briefcase" of the sugarsync program set up. This lets me share the contents of that folder with my other computer in real time (which has the same "magic briefcase" folder).

since python is installed on my c: disk, I need to save my .py files on the the c disk, but of course "magic briefcase" folder is on my d: disk. So will be great to have the contents of the c: disk automatically forward to the d: disk.

Is this possible???

Thanks Darren

Foi útil?

Solução

mklink /J "D:\magic briefcase\python" C:\users\myname\python
should do what you want, I think.
That creates a "junction" aka hardlink between the two directories. Essentially you have one directory that's accessible via two different paths. Add a file to one of them, and it just is in the other one - no copying needed. Ditto for deletes, edits, etc.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top