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

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

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.

Related

Move files incrementally by file size and wait till the destination gets emptied before moving files again either using Robocopy or Powershell

I would like to ask how can I move files from a source folder to a destination folder as shown in the image. The sum of file size from the source folder can only be moved not larger than 7GB (or I can set that depending on the largest single file like 5GB) and then wait for the files moved to the destination folder to get ingested (emptied) before moving again the next batch of files.
I have an idea of using a Robocopy or Powershell script that moves the files and is automatically triggered using a Task Scheduler but I have no experience scripting on any of these.

Attempting to use MKLINK to link folders between two hard drives but keep getting an error

So I'm currently running out of space on my C: Drive which I store windows on currently and I wish to create a link between my C: Drive and my E: Drive so that I can store Custom Content files without taking up more space on my C: Drive.
For those who don't know how The Sims custom content files work; Files are stored within the documents folder through the Electronic Arts game folder. Now, this Electronic Arts folder is stored on the C: Drive. So why don't I simply move the Electronic Arts folder? Because unfortunately, for whatever reason, if there is no Electronic Arts folder present in it's designated spot on your C: Drive, it automatically creates a new folder upon starting the game(No other way to fix this). Hence why I have resulted to this method. It has worked for multiple others but not for myself.
>> cmd /c mklink /C C:\Users\Eun\Documents\Electronic Arts\The Sims 4\Mods E:\The Sims 4\Sims 4 Mods\Mods
Invalid switch - "C".
This is currently what I have entered into Windows PowerShell and I've been running it through Administrator. I've moved all my files into the new folder on my E: Drive already and have left my C: folder empty. I have also checked all spelling and capital letters as I know this stuff can be very sensitive.
So I'm assuming that my D: Folder is supposed to be my real_dir and my C: is my symlink_dir. Then again I could have misunderstood completely since I'm new to this and trying to read my way through it. If anyone is able to assist me with why the command is not working, I'll be very thankful.

Zip files with encryption in a remote share, keeping orignal names and location

My team faces the need to encrypt all files in a repository with AES256. For this purpose, we decided we are going to zip all files with such encryption, using the same key for all of them.
The problem we have is that these files sit in a NAS, so from windows boxes they are accessible by \ to them.
The directory structure is something like this:
Original Structure:
Root
-1
|--folder1
|---file1.ext
|---file2.ext
|--folder2
|---filea.ext
|---fileb.ext
|--folder2.a
|---filec.ext
and so on...
Essentially, what we need is to have all the original files contained in a zip file, keeping their original names, which would be something like this:
Desired Outcome:
|-Root
|-1
|--folder1
|---file1.zip
|---file2.zip
|--folder2
|---filea.zip
|---fileb.zip
|--folder2a
|---filec.zip
and so on...
To accomplish this, we tried a batch script that calls 7zip, but it only works if it's run from the root directory, which is something we cannot use as the files are not in a server.
Here is the syntax of the batch script we came up with:
FOR /R %%i IN ("*.wmv") DO "C:\Program Files\7-Zip\7z.exe" a -mx0 -tzip -pPasswordHere "%%~dpni.zip" "%%i"
But, as wrote previously, it only works when run from the root folder, which is something we cannot do as files sit on a network location.
Mapping the drive or making a symbolic link to it doesn't do the trick either.
I've also checked on 7zip to do this, namely, making use of its "-r" operator, but I couldn't find a way to get the desired outcome (namely, recurse through all folders in the remote tree structure -there are a lot of them...- and keep the original file name).
I'm open to any suggestions as any kind of script, trick or guizmo that gets the job done will be more than welcome. =)
Thanks a million in advance!,
Sebas.
----SOLUTION----
I actually found a sollution here, mapping the drive in a different way (it's so simple it just made me feel stupid(er), but it's altogheter beautiful).
Using the batch script below, the remote share can be mapped like so:
You can map a drive using
net use X: \\server\directory
and then you can change to that directory using
pushd X:
(Post from which the answer was taken from: Batch File Iterating through files on a local network server)

Robocopy option to force copy fail if destination folder does NOT exist

I'm trying to use Robocopy as part of my backup procedures, whereby backup files are copied from one disk to another (for secondary and tertiary backups). I basically have one key external drive for primary backups, and then various of the backups get siphoned off to other disks, depending on which disk it is. I want to develop a sequence of Robocopy commands in a batch file that I can use in any situation, so that if the Robocopy command tries to copy a folder from the source to a destination drive where there is no matching folder, it automatically FAILS and moves on to the next command. Robocopy by default creates the destination folder if it does not already exist, and I want to switch this default OFF if at all possible.

Shadow copy to clone system volume on Windows XP

I am looking for a program that uses shadow copy to copy the contents of a Windows XP system volume that is running.
I.e. I want to clone the system volume with the following snags:
(1) I want to be able to select which files to copy (i.e. not the entire file system)
(2) This is probably implied by (1), but I also have to avoid sector-by-sector copies
(3) I do not want to clone a file system into an image file and restore to a 3rd drive but want to do a filesystem to filesystem copy
All the backup/clone utilities I looked into stumble on one of above points. Any ideas?
Perhaps this one: Hobocopy