Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Directory is mirrored correctly but *.txt; *.pdf, and *.rtf files are empty #54

Open
g-topix opened this issue Nov 4, 2022 · 2 comments

Comments

@g-topix
Copy link

g-topix commented Nov 4, 2022

My attempt to copy a directory with subdirectories and *.txt; *.pdf and .rtf files and simultaneously ignore all larger files (.exe; *.rar; *.msi) over 5000 bytes works only partially. The directory structure is copied correctly, but the contents of the *.txt; *.pdf, and *.rtf files are not present. These copied files remain empty with 0 kb.

What am I doing wrong?

Name Microsoft Windows 7 Professional Version 6.1.7601, NET Framework 4.8

Applied parameters:

`*:\NewBackup\DoInstall_Programms\ChoEazyCopy\ChoEazyCopy v2.0.0.1>prompt $G

RoboCopy.exe ":\NewBackup\DoInstall_Programs" ":\NewBackup\DoInstall_ChoEazyCopyList" . /E /LEV:3 /COPY:DAT /SECFIX /TIMFIX /MIR /A+:A /CREATE /IA:ACE /XA:C /MAX:5000 /V /TS /BYTES /LOG:"*:\NewBackup\DoInstall__ChoEazyCopyList" /LOG+:"ChoEasyCopyLog" /NJH

Log: *:\NewBackup\DoInstall__ChoEazyCopyList

exit`

In other words, I want to copy only the directory structure including the text, PDF and RTF files in it. All other file formats should not be copied. How can this be done?

@GhostCoder0
Copy link

From robocopy /?

/CREATE :: CREATE directory tree and zero-length files only.

The /CREATE option is causing this.

@GhostCoder0
Copy link

here's a simplified command to do what you described:

robocopy "X:\NewBackup\DoInstall_Programs" "X:\NewBackup\DoInstall_ChoEazyCopyList" *.txt *.pdf *.rtf /E

simply replace the drive letter, I put X: here as a placeholder.

/E is telling robocopy to include every subfolders, even empty ones.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants